while through loops with and without condition
Posted: Wed Jun 27, 2007 11:38 am
I have two queries to furfil.
SELECT * FROM slabs WHERE id is not present in table2.slabs_id
SELECT * FROM slabs WHERE id is present in table2.slabs_id
Basically I want to find if one a row from a table has a link/join to another table, and the complete opposite.
So I can filter out results that are present in another table and ones that arent.
The only way I can think of doing it is looping through table 2 and getting the row details then. Just wondered if theres away todo the above!
Hope I explained myself.
SELECT * FROM slabs WHERE id is not present in table2.slabs_id
SELECT * FROM slabs WHERE id is present in table2.slabs_id
Basically I want to find if one a row from a table has a link/join to another table, and the complete opposite.
So I can filter out results that are present in another table and ones that arent.
The only way I can think of doing it is looping through table 2 and getting the row details then. Just wondered if theres away todo the above!
Hope I explained myself.