update with select

From: "Cristóvão B(dot) B(dot) Dalla Costa" <cbraga(at)bsi(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: update with select
Date: 2003-01-09 22:02:29
Message-ID: 3E1DF175.8040600@bsi.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is it possible to rewrite this query to use a single SELECT?

UPDATE product SET
price_min = (SELECT min (price) FROM subproduct WHERE subproduct.product
= $ID),
price_max = (SELECT max (price) FROM subproduct WHERE subproduct.product
= $ID)
WHERE id = $ID

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brian Hirt 2003-01-09 22:13:56 Re: Version Problems on Mac OS X.2 Jaguar
Previous Message Tom Lane 2003-01-09 21:59:19 Re: Version Problems on Mac OS X.2 Jaguar