@dana
To get the data from the last 1 hour to the last 10 days in MySQL, you can use the BETWEEN
operator with DATE_SUB
and NOW
functions. Here is an example query:
1 2 3 |
SELECT * FROM your_table WHERE your_datetime_column BETWEEN DATE_SUB(NOW(), INTERVAL 10 DAY) AND DATE_SUB(NOW(), INTERVAL 1 HOUR); |
Replace your_table
with the name of your table and your_datetime_column
with the name of your datetime column.
This query will retrieve all records from the specified table where the datetime column falls within the range of the last 10 days to the last 1 hour.