FederalProgrammer
Programmer
Consider the following data; I need a query that will return ID = 1 only if anotherGroupID = {1, 2, 3}.
I've tried:
But this returns 1 and 2!
I've also tried
ANY IDEAS?
Code:
id | anotherGroupID
----------------------
1 | 1
----------------------
1 | 2
----------------------
1 | 3
----------------------
2 | 1
----------------------
2 | 5
----------------------
2 | 3
----------------------
I've tried:
Code:
Select ID from table where AnotherGroupID = 1 Or 2 Or 3
I've also tried
Code:
SELECT
anotherGroupID,
ID
FROM
table
GROUP BY
anotherGroupID, ID
Having
anotherGroupID = 1 OR
anotherGroupID = 2 OR
anotherGroupID = 3
ANY IDEAS?