How do i exclude the condition in the Result? I just want Table_A.id to be shown.
The query:
SELECT
Table_A.id,
IF(Table_B.bbb > NOW(),
Table_A.aaa,
Table_B.bbb)
AS to_order
FROM
Table_A
LEFT JOIN
Table_B ON Table_A.id = Table_B.table_a_id
ORDER BY to_order DESC;
All suggestions appreciated.