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

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to update the summary in the same table using simple SQL.

Re: How to update the summary in the same table using simple SQL.

From: Kari Pannila <Xkartsa_at_ougf.fi>
Date: 2000/05/30
Message-ID: <39340B07.B603D126@ougf.fi>#1/1

Peter Wu wrote:
>
> Now, I am going to update the sum column but get back error message.
>
> UPDATE pwu7_tmp o SET
> sum =
>
> SELECT SUM( rate )
> FROM pwu7_tmp n
> GROUP BY cat
> )
> WHERE o.cat = n.cat;
>
> ORA-00904: invalid column name

UPDATE pwu7_tmp o SET
o.sum = (SELECT SUM(n.rate)

         FROM pwu7_tmp n 
         WHERE o.cat = n.cat)

;

Regards Kari

(Mr.) Kari Pannila

      Oracle DBA (OCP)

-- 

PS. Delete X from my mail address , it (X) is only for SPAMMERS.
    Poista X mail-osoitteen edestä, se on SPAMmereita varten.
Received on Tue May 30 2000 - 00:00:00 CDT

Original text of this message

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