On Sep 19, 2005, at 12:36 PM, Alain Bertrand wrote:
hi all,
I am porting a program from mysql to sqlite.
The following statement doesn't work correctly with sqlite though it
does
with mysql.
SELECT COUNT(*) AS nb FROM ttd_photos LEFT JOIN ttd_trees ON
ttd_photos.kind=1 AND ttd_photos.refId=ttd_trees.treeId LEFT JOIN
ttd_pots
ON ttd_photos.kind=2 AND ttd_photos.refId=ttd_pots.potId
In my test case, it reports 0 where it should report 2. This is the
LEFT
JOIN part which has a problem ;)
without seeing the data, a good guess would be, "Yes."
LEFT JOIN selects all the rows with values from the left table and
either matching values or NULL from the right table.
--
Puneet Kishor