I have a current SQL request that works OK
SELECT
*
FROM
firstTab
LEFT JOIN
secondTab ON firstTab.id = secondTab.refId
LEFT JOIN
thirdTab ON firstTab.id = thirdTab.refId
WHERE
secondTab.colY IN ('value1', 'value2')
AND thirdTab.colZ IN ('value3', 'value4')
So far so good.
The problem is that I get the result only for rows when there are data for the values in colA or colB (which is the normal behaviour).
(currently I only get
colY colZ currentResult
--------------------------------------------
row1 value1 value3 resultA
row3 value2 value3 resultB
)(normal behaviour)
I wish to do fill the missing values with some NULL values in such a way
colY colZ currentResult
--------------------------------------------
row1 value1 value3 resultA
row2 value1 value4 NULL
row3 value2 value3 resultB
row4 value2 value4 NULL
('value1','value2') and ('value3','value4') are given , I know them in advance
I tried to "init" the result with a cartesian product with CROSS JOIN of secondTab and thirdTab but then I am stuck.
How can I achieve this?
Thanks in advance