我有这个遗留的SQL但它似乎不对。 where子句具有所有3个表之间具有OR子句的条件,我相信t2和t3条件的记录根本不会被拾取。我是对的吗?
SELECT
t1.field1, t1.field2
FROM
table1 t1
LEFT JOIN
table2 t2 ON t1.t1_id = t2.t2_ref_id
LEFT JOIN
table3 t3 ON t2.t2_id = t3.t3_ref_id
WHERE
t1.datetimef1 > '2016-11-01 09:45:00'
OR t2.datetimef2 > '2016-11-01 09:45:00'
OR t3.datetimef3 > '2016-11-01 09:45:00'
GROUP BY t1.field1
ORDER BY t1.field1 DESC