I have a very basic mysql table called memberships, that tracks which people belong to which groups. People can belong to many groups.
It contains 3 fields: id, person_id, group_id
I need to select all the person_ids that have group_ids of ’20’ and ’53’. The people must belong to ONLY those 2 groups.
Although you could also go for a
NOT EXISTSformat.