RE: Sum with update

RE: Sum with update

 

  

You could use a sub-query
Update table
Set col_1=(select sum(col_2) from table where ...)

Brian Freeman
Carnegie Technologies/Bluewave Computing
(770) 916-0595 ext. 415
www.carnegie.com/www.bluewave-computing.com



-----Original Message-----
From: Usman Farhat [mailto:Usman.[Email Address Removed]
Sent: Friday, December 19, 2003 6:10 AM
To: LazyDBA.com Discussion
Subject: Sum with update


Hi Everyone,

How can we use "Sum" with update.

Situation like this

Update Table
Set Col_1 = Sum(Col_2)


Thanks,
Usman

--------------------------------------------------------------------
NOTA CONFIDENZIALE:
Questo messaggio ed i suoi allegati sono indirizzati esclusivamente
alle persone indicate in testa e possono contenere informazioni
confidenziali. Se avete ricevuto il messaggio per sbaglio, sappiate
che qualunque utilizzo improprio del contenuto è proibito, Vi
preghiamo quindi di inoltrarlo immediatamente al mittente e di
cancellare il messaggio. Per qualsiasi informazione vi inivitiamo a
contattarci scrivendo a [Email Address Removed]

Grazie

CONFIDENTIALITY NOTICE:
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof is prohibited. Please return it immediately to the sender and delete the message. Should you have any questions, please contact us by replying
to [Email Address Removed] you
--------------------------------------------------------------------

---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY Get today's cartoon: http://www.LazyDBA.com To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page