Search Postgresql Archives

Re: trying to write a bit of logic as one query, can't seem to do it under 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




it would be that, but with greatest

thank you.  that's the exact query i was failing to write !

On Apr 21, 2010, at 8:51 PM, Glen Parker wrote:

UPDATE
 cart_item
SET
qty_requested_available = least(cart_item.qty_requested, stock.qty_available)
FROM
 stock
WHERE
 cart_item.stock_id = stock.stock_id AND
qty_requested_available <> least(cart_item.qty_requested, stock.qty_available);


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux