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
 General SQL Server Forums
 New to SQL Server Programming
 Distinct Search

Author  Topic 

asif372
Posting Yak Master

100 Posts

Posted - 2011-12-09 : 02:37:57
My Data is Like This
NUMS NAMES TIMES
1 asd '2008-01-26 13:41:53.623'
1 asd '2009-01-26 13:41:53.623'
1 asd '2010-01-26 13:41:53.623'
2 re '2008-01-26 13:41:53.623'
2 re '2009-01-26 13:41:53.623'

I want Distinct NumS with Top Times
I want data like this

1 asd '2010-01-26 13:41:53.623'
2 re '2009-01-26 13:41:53.623'
Thanks in Advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-12-09 : 02:40:05
[code]
select NUMS, NAMES, MAX(TIMES)
from Yourtable
group by NUMS, NAMES
[/code]


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

Go to Top of Page
   

- Advertisement -