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)
 Select the first distinct date...

Author  Topic 

darreny
Starting Member

5 Posts

Posted - 2001-03-09 : 15:09:42
I was wondering how I might select distinct user IDs from a table. For example I have a table (userLog) with columns: id (unique), userId (not unique, but unique to the a user), siteVisited, timeStamp

How might I select a distinct userId with the oldest timeStamp?

I can get the distinct userId (SELECT DISTINCT userID FROM userLog) but can't return the most recent timeStamp from the userId.

Thanks in advance!

Darren
<><
   

- Advertisement -