List:General Discussion« Previous MessageNext Message »
From:Douglas Forrest Date:February 1 2002 4:22am
Subject:Re: Update syntax
View as plain text  
You can't  in a single SQL statement in MySQL:  MySQL does not allow updates
based upon joins.

Program around it using whatever language (perl, php, etc.) that you're
running the SQL statements from.

----- Original Message -----
From: "Vadim Kulikov" <vadim@stripped>
To: <mysql@stripped>
Sent: Thursday, January 31, 2002 10:00 PM
Subject: Update syntax


> Greetings:
>
> I'm trying to update a table T1 based on the condition which is a result
> of the key join table A and table B
>  the following command works with SYBASE but doesn't with MySQL:
>
>
> update A,B set A.field2='test' where A.field1=B.field1 and
> B.field5='test2'
>
>
>
>
> What's the correct syntax for it ? Or is there another way to accomplish
> that.
>
>
>  Thank you,
> Vadim Kulikov
> vadim@stripped
>
>  Thank you,
> Vadim Kulikov
>  818-428-1001
>
>
> ---------------------------------------------------------------------
> 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 <mysql-thread98244@stripped>
> To unsubscribe, e-mail
<mysql-unsubscribe-dougforrest=earthlink.net@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>

Thread
Update syntaxVadim Kulikov1 Feb
  • Re: Update syntaxDouglas Forrest1 Feb