SELECT a, b,
CASE WHEN z=1 THEN ‘one’ ELSE ‘TWO’ END c
FROM table

addthis_url = ‘http%3A%2F%2Fcallmebird.com%2Fweblog%2Fusing-if-condition-in-select-query’;
addthis_title = ‘Using+If+Condition+In+Select+Query’;
addthis_pub = ‘callmebird’;