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 2000 Forums
 SQL Server Development (2000)
 selection

Author  Topic 

sona
Yak Posting Veteran

68 Posts

Posted - 2001-12-20 : 04:52:49
hai,

I have a resultset like this
Name Time
a 12/1/01 12:00:00 Pm
b 12/1/01 12:30:00 Pm
c 12/1/01 12:00:00 Pm
a 12/1/01 12:30:00 Pm
b 12/1/01 12:00:00 Pm


I want to get like

a 12/1/01 12:30:00 Pm
b 12/1/01 12:30:00 Pm
c 12/1/01 12:00:00 Pm

ie Distinct Names with Greater timevalue
Thanks

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2001-12-20 : 06:57:05
 
SELECT Name, MAX(Time)
FROM tblname
GROUP BY Name




Go to Top of Page
   

- Advertisement -