How can I rewrite a nested query without parenthesis so that it works in MySQL version 4.1.22? (parenthesis work fine in version 5.0.41)
I've got something like this:
SELECT fields
FROM tableA
JOIN tableB
ON tableA.tableA_id = tableB.tableA_id
LEFT JOIN
(tableX JOIN tableY
ON tableX.tableX_id = tableY.tableX_id
AND tableY.date = '2007-11-19')
ON tableB.tableB_id = tableX.tableB_id
(The expression in parenthesis is often NULL either because there are no entries in tableY with the particular date, or because there are no entries in tableX that join with tableY for the particular date)
I've got something like this:
SELECT fields
FROM tableA
JOIN tableB
ON tableA.tableA_id = tableB.tableA_id
LEFT JOIN
(tableX JOIN tableY
ON tableX.tableX_id = tableY.tableX_id
AND tableY.date = '2007-11-19')
ON tableB.tableB_id = tableX.tableB_id
(The expression in parenthesis is often NULL either because there are no entries in tableY with the particular date, or because there are no entries in tableX that join with tableY for the particular date)