Skip to content

How to compare two sets

I need to get all aid’s values which have cid != 40 and cid= 39 (many-to-many connection) I’ve prepared two queries but i don’t know how to except second from first SELECT DISTINCT aid FROM …