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
 Transact-SQL (2000)
 query help - total values

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2006-10-25 : 06:32:01
I have a query as follows

select name,address,amount from customers

is there anyway in sql I can adjust the above query that it should do as above but add on the bottom a row with the total amount?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-25 : 06:38:13
Where do you want to show data?

select name,address,amount from customers
Union all
select '','',SUM(amount) from customers

Also, Read about ROLLUP in sql server help file

Madhivanan

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

- Advertisement -