using LEFT JOIN in microflow in activity: Execute OQL statement

1
hello all, I try to get a list of object via a microflow using the activity: 'Execute OQL statement' il my request, I have a something like: select * FROM a LEFT JOIN b on ... but it is interpreted as JOIN so I only get the results where the a and b are linked instead of getting all the a Do you know why? The LEFT JOIN statement should work...
asked
2 answers
0

Vincent, leave out the ON part. OQL takes care of that for you.

LEFT JOIN … ON… will become JOIN

LEFT JOIN … will become LEFT OUTER JOIN

For OQL testing and samples go to the playground: https://service.mendixcloud.com/p/OQL

answered
0

Hi Vincent,

I have got left join to work in an OQL Statement before, will paste an example here and see if it helps?

1st example is Customer 1-* TOnRecord

2nd example is Account 1-* UserLink

(tested in 9.7)

SELECT
C/CustomerID as CCustID,
C/FullName as CFullname,
TR/FullName as TRFullName,
FROM Main.Customer AS C
LEFT JOIN C/Main.TOnRecord_Customer/Main.TOnRecord AS TR
ORDER BY C/CustomerID
SELECT 
A/FullName as FullName,
L/Name as LName
FROM Administration.Account as A
LEFT JOIN A/Main.UserLink_Account/Main.UserLink as L

 

answered