Jump to content

Mysql Select Most Recent Row?


kensbeijing
 Share

Recommended Posts

Hi say if I had a table like this called members (this was back in the 1970s)User_ID.......Time (unix epoch)1.................241.................5601.................341.................122141.................45... = spaces by the wayHow would I select only 1 row, which has the highest time (latest row)?Would I do this

mysql_query('SELECT * FROM members WHERE User_ID = 1 ORDERBY Time LIMIT 1')

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...