mimivdg2002
MIS
I'm trying to excluding some rows from my resultset. Here is an example:
Table 1: Is the universal set of records (10,000) records
Table 2: Has a subset of the records that exist in Table 1 that meet condition1 (different from condition 2 below)
Table 3: Has a subset of the records that exist in Table 1 that meet condition2 (different from condition 1 above)
What I want to get is records from table 1 that are not in table 2 or not in table 3 something like:
Select * from table1 where table1.id not in (select id from table2) and table1.id not in (select id from table 3)
I'm not getting the result I want from this query. The result I get back gives me records from table1 that don't exist in table2 only. Can anybody please tell me what I'm doing wrong?
Thanks
M
Table 1: Is the universal set of records (10,000) records
Table 2: Has a subset of the records that exist in Table 1 that meet condition1 (different from condition 2 below)
Table 3: Has a subset of the records that exist in Table 1 that meet condition2 (different from condition 1 above)
What I want to get is records from table 1 that are not in table 2 or not in table 3 something like:
Select * from table1 where table1.id not in (select id from table2) and table1.id not in (select id from table 3)
I'm not getting the result I want from this query. The result I get back gives me records from table1 that don't exist in table2 only. Can anybody please tell me what I'm doing wrong?
Thanks
M