Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Update from a subquery

Re: Update from a subquery

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 26 Aug 2004 08:54:21 -0700
Message-ID: <336da121.0408260754.68223b18@posting.google.com>


peteg_at_garlic.com (hedrew3) wrote in message news:<aad10be0.0408252141.6406f6e5_at_posting.google.com>...
> Hello all --
>
> Can't figure out why this doesn't work, and/or how to make it work:
>

What do you mean, doesn't work? Error message or unexpected result?

> I have two tables X (columns A, B, and C), and Y (columns D, E, F,
> ...).
> I am trying to update columns B and C with the minimum values of E and
> F; the join is on columns A and D.
>
> So, I try:
>
> update X
> set (A, B, C) = (
> select D, min(E), min(F)
> from Y
> group by D
> ) Y1
> where X.A = Y1.D
>
> BTW, I don't need to update the value of A, but I don't know if I can
> eliminate that either.
>
> TIA
>
> Pete
Received on Thu Aug 26 2004 - 10:54:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US