Home > DeveloperSection > Forums > Display data Column wise
Manmohan Jha

Total Post:35

Posted on    September-29-2013 11:21 PM

 C# C# 

 1 Reply(s)
 1251  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

Manmohan Jha

Total Post:35

Posted on    September-30-2013 3:33 AM

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?

Don't want to miss updates? Please click the below button!

Follow MindStick