CASE / WHEN in T-SQL

CASE picks a value by conditions, like if and else if. Use it to label rows, to count only the rows that match with SUM(CASE ...), and to sort in a custom order.

Updated

Cheat sheet: CASE / WHEN in T-SQL
Category
SQL
Level
Journeyman
Tags
CASE Expression, sql, t-sql