i want to count the data in current date last hour (for example now() is 2020-04-11 12:30:00 , then i want to get data before 12. any idea ?
table_a
timestamp
2020-04-11 10:00:00
2020-04-11 10:00:00
2020-04-11 11:00:00
2020-04-11 12:00:00
2020-04-11 12:30:00
expected results:
timestamp count
2020-04-11 10:00:00 2
2020-04-11 11:00:00 1
2020-04-11 12:00:00 1
i'm using mysql 8