Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 select a row using max func.....

Author  Topic 

younas02
Starting Member

28 Posts

Posted - 2012-06-27 : 01:38:47
i want to select all columns of a row using max() function. for example
i m using
select testname,max(marks) from table where name='ali' group by testname it gives corect result. i.e, rows with maximum marks in different subject. but when i use more than 2 column it gives all row where name='ali'.
considering 6 total records with 2 records of each subject mean 3, subjects 2 test result records of each.
i want to select rows with maximum marks . in case of 3 subjects i require only 3 rows with maximum marks
plz help me......

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-06-27 : 03:30:11
Please do not cross post.

Duplicate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=176193


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -