|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 5:32 AM
Points: 124,
Visits: 324
|
|
Dear, I have a table Student(Section, Roll, Subjects, Marks). Now I want to display the results like the following. That means the result will show section and Roll wise Subjects, Marks from the Student table. I am using SQL Server 2008 R2.
Please help me to design the query.
Section| Roll | Subjects | Marks ------- ----- ---------- ------- X 1 A 70 B 60 C 80 Y 1 A 75 B 85 C 80 Z 1 A 90 B 78 C 80
Regards, Akbar
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Yesterday @ 2:39 PM
Points: 1,456,
Visits: 14,268
|
|
shohelr2003 (1/6/2013)
Dear, I have a table Student(Section, Roll, Subjects, Marks). Now I want to display the results like the following. That means the result will show section and Roll wise Subjects, Marks from the Student table. Please help me to design the query. Section| Roll | Subjects | Marks ------- ----- ---------- ------- X 1 A 70 B 60 C 80 Y 1 A 75 B 85 C 80 Z 1 A 90 B 78 C 80
Regards, Akbar
untested
SELECT Section.Roll,Subjects,SUM(Marks) FROM Student GROUP BY Section,Roll,Subjects
__________________________________________________________________ you can lead a user to data....but you cannot make them think ! __________________________________________________________________
|
|
|
|