Please masters, I have three table, that I need to select data from using a LEFT JOIN;
and that I need to order by a field q (that exists in table3) but only where state = 1 (that exists also in table3).
I tried this but it doesn’t work :
SELECT * FROM table 1
LEFT JOIN table2 ON x = y
LEFT JOIN table3 ON z=w
WHERE w = 1
ORDER BY q IN ( SELECT q FROM table3 WHERE state = 1);
Please any suggestions ?
How abt this: