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

From: Jonathan Vanasco <postgres(at)2xlp(dot)com>
To: Glen Parker <glenebob(at)nwlink(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trying to write a bit of logic as one query, can't seem to do it under 2
Date: 2010-04-22 01:21:57
Message-ID: 6C745CB3-183F-4937-8C96-FA22D46133E5@2xlp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Mead 2010-04-22 01:34:17 Re: Identical command-line command will not work with \i metacommand and filename
Previous Message Glen Parker 2010-04-22 00:51:21 Re: trying to write a bit of logic as one query, can't seem to do it under 2