Basically mysql doesn't let you use data from one table in updating another 
table.  If you look at the update syntax at 
http://www.mysql.com/doc/U/P/UPDATE.html you'll notice the lack of a very 
much needed FROM option.

later,
mike

At 01:14 PM 9/18/2001 +0100, you wrote:
>Hi everyone.
>
>I'm trying to do the following update, which someone at Macromedia gave me,
>however I get a SQL error when I'm trying to use it with MySQL, any ideas on
>what is wrong.
>
>update general_users
>set rolling_total = sumUsr.rollingTotal
>from
>(
>select id,sum(jan+feb+mar+apr+may+jun+jul+aug+sep+oct+nov+dec) as
>rollingTotal
>from general_users
>group by id
>) as sumUsr
>
>where general_users.id = sumUsr.id
>
>Thanks.
>
>Best Regards
>     >>> Andrew
>
>www.MSOnet.co.uk
>
>
>---------------------------------------------------------------------
>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


---------------------------------------------------------------------
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