I am having problems figuring out how to accomplish something...
TABLE 1
> Field_ID (prm key)
> Name
TABLE 2
> ID (prm key)
> Field_ID (prm key)
> Stuff
I just want to return all the rows from TABLE 1 that DO NOT have a cooresponding match in TABLE 2.
For instance, this works... but is very slow. Is there a simple way to do this? I can't seem to figure out how to do a join that returns all rows from a table where the records do not match.
select * from TABLE1 where field_id NOT IN (select distinct field_id from TABLE2);
TABLE 1
> Field_ID (prm key)
> Name
TABLE 2
> ID (prm key)
> Field_ID (prm key)
> Stuff
I just want to return all the rows from TABLE 1 that DO NOT have a cooresponding match in TABLE 2.
For instance, this works... but is very slow. Is there a simple way to do this? I can't seem to figure out how to do a join that returns all rows from a table where the records do not match.
select * from TABLE1 where field_id NOT IN (select distinct field_id from TABLE2);
Comment