• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

Newest Record from each user in table?

I have a table that is layed out like this:

TableName
          id
          timestamp
          login
          data

I need to get the newest data for each user. But I can't get duplicates per user.

How would I formulate that query?

Thanks
0
cybertrickle
Asked:
cybertrickle
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
select t.*
from tablename t
where t.timestamp = ( select max(i.timestamp) from tablename i where i.login = t.login )
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now