This is a very FAQ:

SELECT t1.*
FROM TABLE_1 t1
LEFT JOIN TABLE_2 t2
        ON t1.id = t2.table1_id
WHERE t2.id is null

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine 

"Ronan Lucio" <[EMAIL PROTECTED]> wrote on 10/27/2004 10:12:42 AM:

> Hi,
> 
> I have two tables:
> 
> TABLE_1
> =======
> - id
> - name
> 
> TABLE_2
> =======
> - id
> - table1_id
> - name
> 
> How could I make a select on table_1 that returns me only the
> rows that donīt have any reference in table_2?
> 
> Any help would be appreciated.
> 
> Thankīs,
> Ronan
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 

Reply via email to