Here is the simple question to gain some medals 🙂 :
I have three tables:
“contacts” that holds the contacts information where each entry has a unique id.
The second table “groups” where is stores the name for each group and the group id.
The last “contacts_groups” binds each contact to a group, it has just two columns, contact_id and group_id.
The question is how do write in a single statement a MySQL query that will select all contacts that are not assigned to a group. In other words contacts which id is not listed in “contacts_groups” table?
1 Answer