RosettaCodeData/Task/Conditional-structures/MariaDB/conditional-structures-1.sql

10 lines
276 B
SQL

SELECT
IF(can_fly, 'Superman', 'Batman'),
-- replace NULL with string
IFNULL(can_fly, 'Not clear if this user can fly'),
-- alias for IFNULL
NVL(can_fly, 'Not clear if this user can fly'),
-- replace '' with NULL
NULLIF(can_fly, '')
FROM user;