I'm trying to return different data depending on a variable in a SELECT. Something like this:
SELECT
IF @variable = 'YES'
column1, column2
ELSE
column3
FROM TABLE
What is this the proper way to use the IF condition in SQL? Or is there a better alternative to what I'm trying to accomplish?