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

10 lines
276 B
MySQL
Raw Permalink Normal View History

2024-10-16 18:07:41 -07:00
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;