If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

SQL: Transform SELECT results with CASE

A CASE expression can be useful for mapping column values to new values. To use it, type CASE followed by a series of WHEN ... THEN ... expressions, an optional ELSE ..., and then END followed by the name of the new column.
For more details, see the SQLite reference for CASE.
▶️ You can also learn about this in our Calculating results with CASE talkthrough.

Want to join the conversation?

No posts yet.