DISPLAY DATA COLUMN WISE

Manmohan Jha

Total Post:35

Points:245
Posted by  Manmohan Jha
C# 
C#
 1330  View(s)
Ratings:
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. Manmohan Jha

    Post:35

    Points:245
    Re: Display data Column wise

    Query:-
    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?

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!