SQL Newest Insert

Associate
Joined
7 Sep 2003
Posts
1,897
Location
Bo'ness
HI,

I have a table similar to this stored in a MySQL database. I have change the column names and data just to make it simpler.



What I want to do is select the newest row based on the Insert Time and keep each unique users so then I would end up with something like this.



Any help would be great as google is not being much help. :(


 
Code:
select [name], max(insertdate), jump from table as a

where insertdate = 

(select max(i.insertdate) 
from table i 
where i.name = a.name)

group by [name],jump
Bit messy but that's how you do it :)

Works like a dream thanks. :)
 
Back
Top Bottom