515
515
insert into t2 (group_name) values ('Group A');
516
516
insert into t2 (group_name) values ('Group B');
517
517
insert into t3 (user_id, group_id) values (1,1);
518
select 1 'is_in_group', a.user_name, c.group_name, b.id from t1 a, t3 b, t2 c where a.id = b.user_id and b.group_id = c.id UNION select 0 'is_in_group', a.user_name, c.group_name, null from t1 a, t2 c;
518
select 1 'is_in_group', a.user_name, c.group_name, b.id from t1 a, t3 b, t2 c where a.id = b.user_id and b.group_id = c.id UNION select 0 'is_in_group', a.user_name, c.group_name, null from t1 a CROSS JOIN t2 c;
519
519
is_in_group user_name group_name id