Reputation: 6477
I have a form where you can enter an date, now in my table i have these fields:
What I need is the previous record(/date) based on the given timestamp, I really have no idea on how to do this in MySQL.
Any help would be greatly appreciated!
Upvotes: 0
Views: 98
Reputation: 10239
SELECT * FROM table WHERE timestamp < :myTimeStamp ORDER BY timestamp DESC LIMIT 0, 1
Upvotes: 1