Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have table A with this data
StudentID Subject Score
S001 Maths 40
S001 English 60
S002 Maths 66
S002 English 43
S003 Maths 78
S003 English 30

I want to create a view that will represent it in this form in sql server 2008
StudentID English Maths
S001 60 40
S002 43 66
S003 30 78

Can some one help me out?
Posted
Comments
Amol_B 24-Jan-13 5:24am    
This can be achieved by using PIVOT

1 solution

You can use PIVOT query,
http://msdn.microsoft.com/en-us/library/ms177410(v=sql.100).aspx[^]

try your self and get back to us if you need any more help
 
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