Say I have a table with 2 columns, ID and DEPARTMENT.
ID DEPARTMENT
1 A
1 B
1 C
1 D
2 B
2 D
3 B
3 D
3 E
4 NULL
I need a select that will give me the ID's who do not have a corresponding DEPARTMENT A or C or who have NULL in the DEPARTMENT field.
So in this case the result set will be ID's 2,3 and 4 because ID one contains DEPTS A and C. If the ID has an A or a C I do not want it.
Any ideas? Thanks.
ID DEPARTMENT
1 A
1 B
1 C
1 D
2 B
2 D
3 B
3 D
3 E
4 NULL
I need a select that will give me the ID's who do not have a corresponding DEPARTMENT A or C or who have NULL in the DEPARTMENT field.
So in this case the result set will be ID's 2,3 and 4 because ID one contains DEPTS A and C. If the ID has an A or a C I do not want it.
Any ideas? Thanks.