Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
SELECT EmpName, [Visited], [ptp]
FROM
(SELECT EmpName, Code
FROM @ClientVisit) As Souce
PIVOT (COUNT(Code) FOR Code IN ([Visited], [ptp])) As p.


Hi This is My database query it working fine. But Actual my problem is i am mention in the query like [visited],[ptp]. These fields are how to pick database automatically.
Because client add new text in future.
Posted
Updated 2-Apr-12 21:19pm
v2
Comments
P.Salini 3-Apr-12 3:13am    
Don't Repost question
you have already posted here
http://www.codeproject.com/Questions/359303/Using-Pivot-in-SqlServer

1 solution

You have already ask'd this question :Using Pivot in SqlServer[^]
Don't re-post the question, if you're not getting the answer then user 'Improve question' widget and update your question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900