I want to execute a SQL query in mysql something like the below:
SELECT
(0-5) AS `sqlTest`, if(`sqlTest` < 0, 'false', 'true')
But I am getting an error “Unknown column ‘sqlTest’ in ‘field list'”
Note
This is not an exact query. Here the operands 0 and 5 will be replaced
with 2 big Select queries.
Since you’re using MySQL, you can use a temporary to solve it;
Simple demo here.