我有一个日期时间的时间序列,存储在mySQL中的双列,并且想每分钟对时间序列进行一次采样(即,以一分钟的间隔拉出最后一个值)。在一个select语句中是否有一种有效的方法来做到这一点?
蛮力方式将涉及选择整个序列并在客户端进行采样,或者为每个点发送一个选择(例如select * from data where timestamp<xxxxxxxxx order by timestamp desc limit 1)。
select * from data where timestamp<xxxxxxxxx order by timestamp desc limit 1
sql time-series
sql ×1
time-series ×1