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 |
|
Bill Humphrey
Starting Member
4 Posts |
Posted - 2009-05-27 : 04:07:17
|
| How can I select the lowest value for a specific group of records:ID date callsign timearrive1 20/10/2009 AAAA 2501 20/10/2009 BBBB 3002 20/10/2009 CCCC 2673 20/10/2009 AAAA 2403 20/10/2009 CCCC 350I want to extract all sinle rows and only one of the duplicated rows by id where the timearrive value is the lowest |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-27 : 04:16:26
|
[code]select *from ( select *, row_no = row_number() over (partition by ID order by timearrive) from yourtable) t where row_no = 1[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
ergen
Starting Member
5 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Bill Humphrey
Starting Member
4 Posts |
Posted - 2009-05-27 : 10:38:47
|
| Thanks khtanthats what I was looking for |
 |
|
|
|
|
|