mercredi 24 juin 2015

How to approach the following query in sqlite

I am trying to replace the following query in sqlite since it does not support FOJ. I tried the wikipedia approach but not able to complete the following query. Any help is appreciated.

SELECT tb1.col1, tb1.col2, tb1.col3, tb2.col1, tb3.col1.tb3.col2, tb4.col1, XYZ.col1
FROM tb1 
FULL OUTER JOIN tb2 ON tb2.id = tb1.id
FULL OUTER JOIN tb3 ON tb3.id = tb2.someid
FULL OUTER JOIN tb4 ON tb1.id = tb4.id
FULL OUTER JOIN tb5 xyz ON tb3.somecolumn = xyz.somecolumn
FULL OUTER JOIN tb5 pqr ON tb1.somecolumn =pqr..somecolumn
WHERE tb1.id = @someparameter AND tb3.somecolumn IS NULL 

Aucun commentaire:

Enregistrer un commentaire