MySQL 如何获取分钟数据,数据频率为15秒

MySQL how to fetch minute wise data, data frequency is 15 sec

我有这样的数据

2021-10-18 08:00:04
2021-10-18 08:00:19
2021-10-18 08:00:49
2021-10-18 08:01:04
2021-10-18 08:01:19
2021-10-18 08:01:34
2021-10-18 08:01:49
2021-10-18 08:02:20
2021-10-18 08:02:35
2021-10-18 08:20:08
2021-10-18 08:20:23
2021-10-18 08:20:38

我试过

select timestamp, value  from table_1 group by round(unix_timestamp(timestamp)/(1 * 60));

它给我的是按分钟计算的数据,但在某些时候,它在同一分钟内给出了 2 条记录。

Output:
2021-10-18 08:00:04
2021-10-18 08:00:49
2021-10-18 08:01:34
2021-10-18 08:20:08
2021-10-18 08:20:38
2021-10-18 08:21:38
2021-10-18 08:22:39
2021-10-18 08:24:54

我的预期输出如下:-

    2021-10-18 08:00:04
    2021-10-18 08:01:34
    2021-10-18 08:20:08
    2021-10-18 08:21:38
    2021-10-18 08:22:39
    2021-10-18 08:24:54
enter code here

如何解决同一分钟的重复记录问题?

使用 datehourminute 函数

select max(timestamp)
from table_1 
group by date(timestamp), hour(timestamp), minute(timestamp)