clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2555298 fiddles created (37430 in the last week).

-- У нас есть несколько коробок CREATE TABLE boxes ( id INT UNSIGNED NOT NULL, title VARCHAR(255) )
 hidden batch(es)


INSERT INTO boxes(id, title) VALUES (1, 'first'), (2, null), (3, null)
 hidden batch(es)


SELECT * FROM boxes WHERE title <=> IF ('first' = '', title, 'first')
id title
1 first
 hidden batch(es)


SELECT * FROM boxes WHERE title <=> IF ('' = '', title, '')
id title
1 first
2
3
 hidden batch(es)