Display data Column wise

Total Post:33


 1670  View(s)
Rate this:
Hello developers...

I have some problem

My Sql table look like this..

Session               Student Id     Subject       MarksType      Marks
2013-2014         S00001         Math          FA1                 50
2013-2014         S00001         Hindi          FA1                 60
2013-2014         S00001         English       FA1                  62
2013-2014         S00001         Math          FA2                 55
2013-2014         S00001         Hindi          FA2                 62
2013-2014         S00001         English       FA2                  70

But i want print like this

Session               Student Id     Subject       FA1             FA2
2013-2014         S00001         Math          50                55
2013-2014         S00001         Hindi          60                62
2013-2014         S00001         English       62                 70

Help me...

Thx & regards
Manmohan Jha
  1. Re: Display data Column wise

    In Access 2007

    TRANSFORM Avg(Marks) as Mrk  SELECT Subject FROM StudentsMarks WHERE Session='2013-2014' AND Student Id='S00001' GROUP BY Session_,Student Id, Subject PIVOT MarksType In (FA1, FA2)

    How to use same query in Sql?


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.