[ Programing ]/Database
[SQL] CASE WHEN
Mister_Q
2024. 2. 27. 11:00
# CASE WHEN : IF 조건과 동일하게 사용 가능.
> SELECT
CASE
WHEN (1 > 2) THEN 11
ELSE 99
END AS _IF
-- 99
> SELECT
CASE
WHEN (1 > 2) THEN 11
WHEN (2 > 1) THEN 22
ELSE 99
END AS _IF
-- 22