List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:July 18 1999 4:20pm
Subject:Re: can MySQL update on a join?
View as plain text  
sinisa@stripped wrote:
> 
> David Kaufman writes:
>  > I just tried (something like) the following
>  >
>  > update
>  >     order,
>  >     customer
>  > set
>  >     order.status = 'Canceled'
>  > where
>  >     order.customer_id = customer.id AND
>  >     customer.type = 'Deadbeat'
>  >
>  > and got a snytax error near ",customer".  looking at the docs it seems this
>  > syntax (specifying two tables to update a single table based on the results
>  > of their join) isn't supported in MySQL??
>  >
>  > isn't this ANSI SQL?  or am i Sybase-spoiled?  or am i missing something in
>  > how to do this?  it *has* been awhile...
>  >
>  > tia,
>  >
>  > -dave
>  >
>  >
>  >
> 
> Hi Dave!
> 
> Yes, you are Sybase spoiled. ANSI SQL92 allows all id's in UPDATE
> clause to belong to a single table, or to be constants.
> 
> But, you might suggest that MySQL follows the steps of Sybase versus
> UPDATE syntax .....
> 
> Sinisa
> 
> +----------------------------------------------------------------------+
> | TcX  ____  __     _____   _____  ___     ==  mysql@stripped            |
> |     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic          |
> |    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped|
> |   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaka, Cyprus             |
> |  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                             |
> |  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                            |
> |             /*/             \*\                Developers Team       |
> +----------------------------------------------------------------------+
> 
> 

And if you buy some level of support, especially extended login support,
you will have a lot of say in how soon this gets implemented :-)


-- 
Sasha Pachev
http://www.sashanet.com
Thread
can MySQL update on a join?David Kaufman18 Jul
  • can MySQL update on a join?sinisa18 Jul
  • Re: can MySQL update on a join?Sasha Pachev18 Jul
Re: can MySQL update on a join?Kevin Smith18 Jul