SQL Pivot statement

Is there any way the attached select can be done where I just grab all values in the disqualifyReason columns without having to actually declare them?

I don't want to have to put the...
[Qualified], [DebtConsol], [Disability],....etc...

unless I have to


SELECT rep, [Qualified], [DebtConsol], [Disability], [Loans], [Lottery], [needLegal] , [PreSettlement], [Restitution], [RetVet], [SocialSecurity], [WorkComp], [ExistsTransferred] 
into #tempData FROM CALLDETAIL.dbo.inboundCalls T
 pivot (COUNT(disqualifyReason) 
			FOR disqualifyReason IN ([Qualified], [DebtConsol], [Disability], [Loans], [Lottery], [needLegal], [PreSettlement], [Restitution], [RetVet], [SocialSecurity], [WorkComp], [ExistsTransferred])) pvt;

Open in new window

Larry Bristersr. DeveloperAsked:
Who is Participating?
 
Patrick MatthewsCommented:
0
 
Larry Bristersr. DeveloperAuthor Commented:
Perfect...thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.