DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

Conditionals — Example 69

Quick explanation + ready code for: Conditionals.

SQL Conditionals Back to examples
Back to language
Syntax: Conditionals in SQL. ID: #69

Code

SELECT CASE WHEN 22%2=0 THEN 'even' ELSE 'odd' END AS parity;

Notes

You can copy this snippet and adapt it. For advanced, add real-world inputs, edge cases, and tests.