I have tables:
users:
id | name
1 | first name
2 | second name
3 | third name
4 | fourth name
projects:
id | name
1 | first
2 | second
projectInvitees:
id | userId | projectId
1 | 1 | 1
2 | 2 | 1
3 | 2 | 2
4 | 3 | 1
I want a record like: the project which must has minimum both assignee userId with 1 and userId with 2
I tried:
select projectId from projectInvitees where userId IN (1, 2);
but it returns projectId 1 and 2, because I user IN but as I mention I want the only projectId 1
Can any one guide me with this