I've one table with 1 million of rows and I want to get the rows with min date and formatted by day.
My table is:
Id Created_at Value
1 2019-04-08 10:35:32 254
1 2019-04-08 10:31:23 241
1 2019-04-08 11:47:32 258
2 2019-04-08 10:32:42 276
2 2019-04-08 10:34:23 280
2 2019-04-08 11:34:23 290
And I would like to get (the min created_at values for each hour and format by hour):
Id Created_at Value
1 2019-04-08 10:00:00 241
1 2019-04-08 11:00:00 258
2 2019-04-08 10:00:00 276
2 2019-04-08 11:00:00 290
I have mysql 5.7 so I can't build windowed queries. I'm researching the most efficient way to select this elements.