update with select - Mailing list pgsql-general

From Cristóvão B. B. Dalla Costa
Subject update with select
Date
Msg-id 3E1DF175.8040600@bsi.com.br
Whole thread Raw
List 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.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Version Problems on Mac OS X.2 Jaguar
Next
From: Brian Hirt
Date:
Subject: Re: Version Problems on Mac OS X.2 Jaguar