0

I have a table with the following format:

Student_ID | Year | Subject | Grade
------------------------------------
1          | 2009 | Math    | 90

1          | 2009 | English | 70

2          | 2009 | Math    | 80

2          | 2009 | English | 95

1          | 2010 | Math    | 75

1          | 2010 | English | 85

I want a table that looks like this:

Student_ID | Year | Math Grade | English Grade
------------------------------------
1          | 2009 | 90         | 70

2          | 2009 | 80         | 95

1          | 2010 | 75         | 85

How can I accomplish this?

Zach B
  • 23
  • 4
  • The duplicate solves your problem, you will `PIVOT` the subjects into new columns and the grade will be the value inside of the aggregate function. You should try some of the code from that solution and if it doesn't work, post the code that isn't working. – Taryn Jun 01 '17 at 15:07
  • 1
    Thank you I figured it out now! – Zach B Jun 01 '17 at 15:27

0 Answers0