Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

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

0
lrbrister
Asked:
lrbrister
1 Solution
 
Patrick MatthewsCommented:
0
 
lrbristerAuthor Commented:
Perfect...thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now