Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server
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 23-Jan-13 20:37pm
Comments
Amol_B at 24-Jan-13 5:24am
   
This can be achieved by using PIVOT

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100