Query MSSQL Tutorial

CASE
    WHEN conditional_expression_1 THEN result_expression_1
   [WHEN conditional_expression_2 THEN result_expression_2]...
   [ELSE else_result_expression]
END