Users UserGroup
id name rowid GrpID UserID name
1 aaa 1 1 1 aaa
2 bbb 2 1 3 ccc
3 ccc 3 2 1 aaa
4 ddd 4 2 4 ddd
5 eee 5 2 5 eee
I have 2 table, user and usergroup, I want to display all the name from user table but except the userID which is associated with GrpID in the userGroup Table.
for grpID 1 i want to display
bbb
ddd
eee
I dont want to display userid 2 and 3 because it in grpID 1. I will have many grpID. How to do it in my sql. I dont want to display the name that Is already in UserGroup Table for GrpID 1.. and same condition for other GroupID