Mattias Persson writes:

> I have two tables, one for the articles and one with orderrows. When I update the 
>price in the article table i want to make a query to update the price in orderrows on 
>all rows with a certain orderstatus.
> 
> Can anyone please help me!!!

>From the manual:
"[...] new features of MySQL 4.1 [...] we will also include simpler
additions, such as multi-table UPDATE statements."

For now, you will have to consider doing it with one query per
changed price (or whatever), or just normalize your data a bit
more, so that you never store the same piece of information in
two places. You could possibly use a INSERT...SELECT to a temp
table, and then REPLACE from that, although you'll probably need
to do table locking to avoid losing simultaneous updates to the
table.

//C

-- 
 Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
 Amiga user since '89, and damned proud of it too.


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