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.
Author |
Topic |
vinothrao84
Starting Member
21 Posts |
Posted - 2007-10-08 : 23:02:07
|
Hi,Below are my sample records in a SQL table.FName ........ Points.......DateToyota ........150..........05/12/2005Honda ........ 115 .........10/10/2003Mitsubishi.....120..........06/06/2005Toyota.........130..........01/01/2005Honda .........135 .........11/07/2003Mitsubishi ....110..........16/06/2005Toyota ........160..........25/11/2005Honda .........125..........12/12/2003Mitsubishi.....110 .........26/02/2005I want to get the result as below.Toyota ........160Honda .........135Mitsubishi.....120How can i get the TOP 1 records for each FName column?Pls Help.Thx. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-10-08 : 23:08:14
|
SELECT FName, MAX(Points) AS PointsFROM YourTableGROUP BY FNameTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-10-09 : 02:15:07
|
Tara, why do you get all the hard queries?  E 12°55'05.25"N 56°04'39.16" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|