Click here to Skip to main content
13,051,809 members (60,603 online)
Rate this:
Please Sign up or sign in to vote.
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 23-Jan-13 20:37pm
Amol_B 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2017
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