Conditional values
From SQLZoo
Conditional values
schema:gisq
The SQL Standard is the CASE statement
SELECT title,
score,
IIF(score>8.5,'Excellent','OK')
FROM movie
WHERE 10>id
SELECT title, score,
CASE
WHEN score>8.5 THEN 'Excellent'
ELSE 'OK'
END
FROM movie
WHERE 10>id
SELECT
title,
score,
CASE WHEN score>8.5 THEN 'Excellent'
ELSE 'OK'
END
FROM gisq.movie
WHERE 10>id
SELECT
title,
score,
CASE WHEN score>8.5 THEN 'Excellent'
ELSE 'OK'
END
FROM movie
WHERE 10>id