Reputation: 160
SELECT * FROM auto_sync WHERE time > UNIX_TIMESTAMP(NOW() - INTERVAL 1 HOUR);
I am trying to fetch data which get added in the past 1 hour from my query but it's throwing me an error on Internal 1. Thank you
Upvotes: 4
Views: 5017
Reputation:
Try this.
SELECT * FROM table_name
WHERE timestamp >= NOW() - INTERVAL 1 HOUR
ORDER BY timestamp DESC
Upvotes: 3
Reputation: 21
SELECT * FROM table_name WHERE timestamp >= NOW() - INTERVAL 1 HOUR ORDER BY timestamp DESC
try this maybe? not sure if timestamp or time, try with both
Upvotes: 1