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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL update query - help please!

Re: SQL update query - help please!

From: Angelo Cavallaro <angelo.cavallaro_at_pcm.bosch.de>
Date: 1998/01/23
Message-ID: <34C86E64.2490@pcm.bosch.de>#1/1

Try this:
update table_a a set
 a.total = ( select sum(b.value)+sum(c.value)+max(d.sub_total)

		from table_b b,table_c c, table_a d
	       where b.id=a.id
		 and c.id=a.id
		 and d.id=a.id);

The MAX-Function is required cause the query is grouped, but if the column ID is the primary key of the table_a its the same value as without MAX.
Angelo. Received on Fri Jan 23 1998 - 00:00:00 CST

Original text of this message

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