Transform values into labels inside a query.
Section: json and string functions
Map values with CASE
sql
sql
SELECT id,
CASE status
WHEN 'paid' THEN 'Paid'
WHEN 'pending' THEN 'Pending'
ELSE 'Other'
END AS status_label
FROM orders;Explanation
`CASE` is essential for SQL-side normalization and reporting.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing json and string functions