Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Combining 2 records into 1

Author  Topic 

Saeed
Starting Member

39 Posts

Posted - 2003-06-26 : 00:38:46

Table
C1 c2 c3 c4 c5
============================================================
123 3 AAA BBBBB 45.00 <------- Rec 1
123 3 AAA BBBBB 54.00 <--------Rec 2

to get this :

123 3 AAA BBBBB 99.00 <---------- Rec 1

How can i be left with the combination of both records in one record
distinctive of c1,c2,c3,c4 Sum(c5)



Thanks



Edited by - Saeed on 06/26/2003 00:46:18

Nazim
A custom title

1408 Posts

Posted - 2003-06-26 : 01:20:59
Check for group by clause in BOL.


select c1,c2,c3,c4,sum(c5)
from tablename
group by c1,c2,c3,c4



HTH



-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson
Go to Top of Page
   

- Advertisement -