Click here to Skip to main content
Rate this: bad
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
Amol_B at 24-Jan-13 5:24am
This can be achieved by using PIVOT

1 solution

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

Solution 1

You can use PIVOT query,[^]
try your self and get back to us if you need any more help

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

  Print Answers RSS
0 OriginalGriff 278
1 Nguyen.H.H.Dang 230
2 Maciej Los 205
3 Peter Leow 195
4 arvind mepani 187

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