I'm trying to create a list of my Registered Users (primary usergroup #2)that are NOT also in secondary group #12. I've tried this
Code:
SELECT email, username FROM user WHERE (usergroupid=2 AND NOT(membergroupids=12));
.. and a few variations thereof, but I haven't hit on the magic combination that excludes the members of group #12.
I don't know if it is germane, but users CAN be in more than one secondary group on my board, so the membergroupids entry for a user could be a series of group numbers strung together with commas, like "8,9,12,13".
I'd greatly appreciate it if somebody could help with the correct query syntax.