I want to do something like this:
SELECT IF((SELECT something FROM table) AS tmp) > 0, tmp, (SELECT bla FROM oter_table))
Unfortunately the 'as tmp' and returing the tmp is not working. How can I get this to work? without doing repeating the query:
SELECT IF((SELECT something FROM table) > 0, (SELECT something FROM table), (SELECT bla FROM oter_table))
JOINstatement?