Hi,

Is it possible to update a field with the result of a select.  For example:

UPDATE ordr_order SET balance = ('SELECT ordr_order.total_cost -
sum(ordr_payment.amount) FROM ordr_order LEFT JOIN ordr_payment on
ordr_payment.ordr_order_id = ordr_order.id WHERE ordr_order.id = 1') WHERE
id = 1

When I execute this query, I don't get an error, but it also doesn't update
the field in question.  If I execute each query separately, they each work
fine.

Thanks for your help.

Daniel Leighton



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