CASE

SQL CASE #

SQL’s way of handling if-then conditionals

SELECT
    CASE
        WHEN <condition> THEN <value>
        WHEN <condition> THEN <value>
        ...
        ELSE <value>
    END AS <name>
FROM <table>;