Re: Problem with delete and left join
Hi,
This is supported in version>=4.0.2
Refer this page...
http://dev.mysql.com/doc/mysql/en/DELETE.html
------------
The first multiple-table DELETE syntax is supported starting from MySQL 4.0.0. The second is supported starting from MySQL 4.0.2. The table_references part lists the tables involved in the join. Its syntax is described in section 14.1.7.1 JOIN Syntax.
The examples show inner joins using the comma operator, but multiple-table DELETE statements can use any type of join allowed in SELECT statements, such as LEFT JOIN.
-------------
If you use Natural join the first syntax ( You have used) is right
but if you use LEFT JOIN then switch to second syntax...
mysql> DELETE FROM t1
USING
t1
LEFT JOIN
t2
ON t1.id = t2.id
WHERE t2.id IS NULL;
Regards,
Ram.
We Learn the Most When we have to Invent
Subject
Written By
Posted
Re: Problem with delete and left join
August 27, 2004 12:02AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.