As seen here: http://www.tsqltutorials.com/pivot.php
What if I don’t have a column I can perform a SUM upon? How do I get a pivot’ed table result?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s always
COUNT(0), another option is to create a common table expression and create an extra column on top of your query with the appropriate value and then use that for the PIVOT.