On Mon, 01 Sep 2003 17:13:20 +0900
Nishant <[EMAIL PROTECTED]> wrote:

> I dont know why my brain stopped working :)
> 
>  I have two tables T1 and T2, both of which have a column : SerialNo
> 
> Now I want to select those rows from T1 whose SerialNo is not present in
> T2.
> 
> This dont work:
> 
> select  T1.* 
>     from 
>     table1 as T1
> straight_join  
>     table2 as T2 
>     where   
>     T1.serialNo != T2.serialNo 
>     order by 
>     T1.serialNo
> 
> Looking for some help.

Look here:
http://www.mysql.com/doc/en/JOIN.html

***
If there is no matching record for the right table in the ON or USING part in a LEFT 
JOIN, 
a row with all columns set to NULL is used for the right table. You can use this fact 
to 
find records in a table that have no counterpart in another table: 

mysql> SELECT table1.* FROM table1
    ->        LEFT JOIN table2 ON table1.id=table2.id
    ->        WHERE table2.id IS NULL;
***

---
WBR,
Antony Dovgal aka tony2001
[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to