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
 General SQL Server Forums
 New to SQL Server Programming
 query to add colums

Author  Topic 

eponcedeleonc
Starting Member

4 Posts

Posted - 2011-08-03 : 14:05:15
I want to know how create a query that would sum the values of column1, column2, etc.. but when the output is display i would like to have it as an excel.. that means..
I think this example wil show more of what I want to accomplishh

TB1 TB2 TB3
2 13 3
4 45 5
5 67 7
7 23 8


TOTAL TB1 TOTAL TB2 TOTAL TB3
18 148 23

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-08-03 : 14:11:30
SELECT SUM(TB1) [TOTAL TB1], SUM(TB2) [TOTAL TB2], SUM(TB3) [TOTAL TB3] FROM myTable
Go to Top of Page

eponcedeleonc
Starting Member

4 Posts

Posted - 2011-08-03 : 15:00:50
Thanks for the help robvolk....I really appreciate it!
Go to Top of Page
   

- Advertisement -