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 |
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2013-01-29 : 12:38:28
|
Hello therei want to create a pivot for a metrics table. but i have lots of headings, is there a way i can do the following if possible. Below is an example of what i have at the moment.select client_ref,[15],[766],[771],[772],[773],[774],[775],[776] lots lots more from(select tickets.client_ref , tickets.occasionid, tickets.transactionid from Ticket_Facts tickets) as querypivot(Count(transactionid) for occasionidin ([15],[766],[771],[772],[773],[774],[775],[776],[777],[778])) as pivis there a way i could do the followingselect client_ref,(select ref from [view]) as client_ref from(select tickets.client_ref , tickets.occasionid, tickets.transactionid from Ticket_Facts tickets) as querypivot(Count(transactionid) for occasionidin (select ref from [view])) as pivjust want to cut down all the listing. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|