groupid NOT IN (SELECT id FROM groups) groupid NOT IN (SELECT id FROM (SELECT id FROM groups) AS groups_ids)