Click here to Skip to main content
15,903,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Marks column, Exam Type Column

Marks Exam Type
20 Test1
40 Test2
50 Test3
60 Test4


In select statement I want These Test1,test2,Test3,Test4 as Alice Name

Test1 Test2 Test3 Test4
20 40 50 60

How to do this in View i.e virtual table?
Posted
Comments
ZurdoDev 6-Jul-12 8:30am    
Look into using the PIVOT sql statement.
bbirajdar 6-Jul-12 8:38am    
Alice ? Are you referring to Alice from Wonderland ?
Arunprasath Natarajan 6-Jul-12 9:36am    
Gud Joke
Arunprasath Natarajan 6-Jul-12 9:37am    
Kindly provide the query, which you have tried out.

Refer:
Five methods converting rows to columns[^]
Hope this solves your problem.
 
Share this answer
 
You need to use the SQL PIVOT statement.

I've answered a very similar question previously. See this answer:

combine multiple rows into one row in sql server[^]
 
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