I'm trying to run SQL procedure with group by conditional expression
ORDER BY
CASE
(WHEN tnx_order = TRUE THEN `txn`.id ASC) END,
(WHEN tnx_order = FALSE THEN `txn`.id DESC) END
LIMIT 1;
And i get this type of error:
SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '
WHEN tnx_order = TRUE THEN `txn`.id ASC) END,