I am trying to select data from a table based on timestamps (stored as int(10)). The timestamps correspond to unix timestamps. I am using MySQL 5.
Question: How can I select the data based on the following rule: get all records, where the timestamp is from 9 to 10 o'clock. Nothing else. Timestamp could be in the 70's or today.
If you're storing the value as a UNIX timestamp, you'll need to convert the value into MySQL's timestamp format before using the HOUR function.
Use
HOUR()
(assuming column is calledtimestamp
)