Hi

I'working with two tables (table1 and table2).

I 'm trying to use a sub-select to delete the lines that are in the 
table2 but are not in the table1
but I didn't get it.

Below the way I've tried:

DELETE FROM Table1 SELECT Table1.* FROM Table1 LEFT JOIN Table2 ON 
Table1.ID=Table2.ID WHERE Table2.ID IS NULL;

DELETE FROM Table1 WHERE IN (SELECT Table1.* FROM Table1 LEFT JOIN 
Table2 ON Table1.ID=Table2.ID WHERE Table2.ID IS NULL);

The two ways do not work nd I  got a Syntax error near  'SELECT 
Table1.........'
The NOT IN Function also did not work .


Can Somebody help me ?
Regards
Claudemir F. Martins



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to