Say I have the query:
SELECT (a + b) AS sum FROM myTable WHERE 1
I want to do something like:
SELECT ((IF a = 0 RETURN 100 ELSE RETURN a END IF) + b) AS sum FROM myTable WHERE 1
but that obviously doesn't work. I just want to add a new value to b that i want if a = 0.
I need to do this in mysql so i can sort results.
Is there an easy way to do this?