﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Designing Complex Query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 01:09:24 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Designing Complex Query</title><link>http://www.sqlservercentral.com/Forums/Topic1403322-391-1.aspx</link><description>[quote][b]shohelr2003 (1/6/2013)[/b][hr]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.[code="plain"]Section| Roll | Subjects | Marks------- -----  ---------- -------X	1	A	    70		B	    60		C	    80Y	1	A	    75		B	    85		C	    80Z	1	A	    90		B	    78		C	    80[/code]Regards,Akbar[/quote]untested[code="sql"]SELECT Section.Roll,Subjects,SUM(Marks)FROM StudentGROUP BY Section,Roll,Subjects[/code]</description><pubDate>Sun, 06 Jan 2013 04:40:19 GMT</pubDate><dc:creator>J Livingston SQL</dc:creator></item><item><title>Designing Complex Query</title><link>http://www.sqlservercentral.com/Forums/Topic1403322-391-1.aspx</link><description>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.[code="plain"]Section| Roll | Subjects | Marks------- -----  ---------- -------X	1	A	    70		B	    60		C	    80Y	1	A	    75		B	    85		C	    80Z	1	A	    90		B	    78		C	    80[/code]Regards,Akbar</description><pubDate>Sun, 06 Jan 2013 04:27:44 GMT</pubDate><dc:creator>shohelr2003</dc:creator></item></channel></rss>