Just quickie,
I need to return a string value based on data from a column.
For example, if data from a column contains "0" I need to return the string "Z", if it doesn't I need to return "C".
Wasn't sure the best way to approach this. Can you do if statements in the middle of a query??
SELECT
column1,
column2,
if (column3 = 0)
begin
'Z',
end
else
begin
'C',
end
FROM table1
Start Free Trial