Connecting Tech Pros Worldwide Forums | Help | Site Map

maximum query

Newbie
 
Join Date: Mar 2007
Posts: 1
#1: Sep 28 '08
i have a table marks having feilds application_no,qualification,year,maxmarks,obtaine dmarks.
in this each year's marks are entered for each qualification andn application.
i want to get maximum of percentages and the qualification for each application. can anybody help me.

thanks in advance.

Member
 
Join Date: Feb 2007
Posts: 36
#2: Sep 29 '08

re: maximum query


Here I assume application_no is unique, table name is "test_result"

select * from
(select qualification, application, max(obtainedmarks) obtainedmarks
from test_result group by qualification, application) summary
inner join test_result details
on summary.qualification = details.qualification and summary.obtainedmarks = details.obtainedmarks and summary.application= details.application

This will give you the idea how to create the query, first understand how the result will be formed and do it in the same way given
Reply


Similar Microsoft SQL Server bytes