clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
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. 1130760 fiddles created (16566 in the last week).

CREATE TABLE `test_set` ( `int` int(11) DEFAULT NULL, `set_2` set('a','b','c') DEFAULT NULL )
 hidden batch(es)


INSERT INTO `test_set` VALUES (0,0), (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7)
 hidden batch(es)


SELECT DISTINCT `int`, SUBSTRING_INDEX(SUBSTRING_INDEX(`set_2`, ',', `mask`), ',', -1) `set` FROM `test_set`, (SELECT 1 `mask` UNION SELECT 2 UNION SELECT 3) `mask` WHERE `set_2` & 1;
int set
1 a
3 a
3 b
5 a
5 c
7 a
7 b
7 c
 hidden batch(es)