Reputation: 151
I have a table that a user placing bets on dUpdateTime
.
My Query :
select * from tbet where iUserKey=53298
How do I create a query that would give me the latest dUpdateTime
with iUserKey = 53298
.
Upvotes: 2
Views: 64
Reputation: 125
Use max aggregate function to get the latest
SELECT MAX(dUpdateTime) FROM tbet WHERE iUserKey=53298
Upvotes: 1
Reputation: 2036
Try this:
select * from tbet where iUserKey=53298 order by dUpdateTime desc limit 1
Upvotes: 1