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 2005 Forums
 Transact-SQL (2005)
 How to do sum of

Author  Topic 

Mageshkumar
Starting Member

29 Posts

Posted - 2008-09-02 : 03:47:52
Hi my tables values like this:

a1 100 Na 22
a1 100 Na2 44
a1 101 Na 66
a2 100 na2 88

Now i need o/p like this:

a1 132
a2 88

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-02 : 04:07:08
select col1,sum(col4) as col4 from table
group by col1

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -