mysql - SQL: select all unique values in table A which are not in table B -
i have table a
id | name | department ----------------------------- 0 | alice | 1 0 | alice | 2 1 | bob | 1
and table b
id | name ------------- 0 | alice
i want select unique ids in table not exist in table b. how can this?
select distinct id tablea not exists ( select id tableb id = a.id )
Comments
Post a Comment