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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-02-23 : 08:18:59
|
| Cassie writes "Can you please help with this Query. I have written a stored procedure that aggregates data and creates a temp table in the following format.Singer Song #Songs sold------ ---- -----------Singer1 Song1 20Singer1 Song2 10Singer1 Song3 5Singer2 Song1 3Singer3 Song1 15Singer3 Song2 12Now I need to add to the Stored procedure to output thedata in the following format, ORDERED BY top selling Singer1. Singer1 Song1 20 Song2 10 Song3 5 Total Singer 1 352. Singer 3 Song1 15 Song2 12 Total Singer 3 273. Singer 2 Song1 3 Total Singer 2 3How do I do this? Thanks for your help." |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2005-02-23 : 09:06:32
|
| >>How do I do this? Thanks for your help."By using a report writer, such as reporting services, crystal reports, Access. It depends on what method you want to use to present this data. Formatting output & creating groups for reports is not something that you do in T-SQL.- Jeff |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-02-23 : 14:36:37
|
| Have a look at the ROLLUP operator,It can be used to deliver totals to the client, the client has to format them of course.rockmoose |
 |
|
|
|
|
|