List:General Discussion« Previous MessageNext Message »
From:Jay Miller Date:July 7 1999 7:05pm
Subject:RE: Problem with DELETE FROM LEFT JOIN WHERE syntax
View as plain text  
> Here's the syntax I'm using, and the error message I get:
>
> DELETE FROM
>   vsnetwork LEFT JOIN master
>   ON master.email=vsnetwork.email
>   WHERE master.email Is Null;
>
> ERROR 1064: You have an error in your SQL
> syntax near 'LEFT JOIN master ON master.email=vsnetwork.email
>  WHERE master.email Is Null;' at line 2
>
> If I change the DELETE command to SELECT COUNT(*), or SELECT *,
> it works great.

While it is a big pain, you cannot use multiple tables in a delete statement
in MySQL.  You have to select, then step through each record and issue a
delete.  I don't know if there are any plans to add this in the future.

Thread
Problem with DELETE FROM LEFT JOIN WHERE syntaxGarret W. Gengler7 Jul
  • RE: Problem with DELETE FROM LEFT JOIN WHERE syntaxJay Miller7 Jul
    • RE: Problem with DELETE FROM LEFT JOIN WHERE syntaxMichael Widenius8 Jul
  • Re: Problem with DELETE FROM LEFT JOIN WHERE syntaxBaruch Even8 Jul