简体   繁体   中英

pull mysql data for the last 60 minutes

Hi I have have a column in my mysql db table called FirstAdded -- the date and is stored in this format:2013-03-04 16:37:05

I would like to pull all the rows added to the database in the past hour based on the FirstAdded column.

I've read around about INTERVAL but don't really know here to start

Can someone please help?

Thanks very much,

This should get you started

SELECT *
FROM Tablename
WHERE FirstAdded > CURRENT_TIMESTAMP - INTERVAL 1 HOUR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM