Re: Select non-matching rows

2004-08-20 Thread Manish
Thanks!!! It works, the only change I needed was - WHERE tbl2..another_id IS NULL rgds, - Manish - Original Message - From: "Johan Hook" <[EMAIL PROTECTED]> To: "Manish" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, August 20, 2004 12:

Re: Select non-matching rows

2004-08-20 Thread Johan Hook
Hi, you could try: SELECT tbl1.id FROM tbl1 LEFT JOIN tbl2 ON tbl2.another_id = tbl1.id WHERE tbl2.id IS NULL /Johan Manish wrote: This should be simple but I am stuck here. I need to select rows from table 1, which do not have matching ID in table 2. Say each table has 100 rows each, and 90 rows f

Select non-matching rows

2004-08-19 Thread Manish
This should be simple but I am stuck here. I need to select rows from table 1, which do not have matching ID in table 2. Say each table has 100 rows each, and 90 rows from table 1 have matching 90 rows in table 2. SO I want to find remaining 10 rows. Simple query such as select tbl1.id from tbl1,