开发者

SQLITE group by

开发者 https://www.devze.com 2022-12-13 01:44 出处:网络
I use the sql below in sqlite to group by time intervals.The first is group by day and the second group by hour:

I use the sql below in sqlite to group by time intervals. The first is group by day and the second group by hour:

select strftime('%Y-%m-%dT%00:00:00.000', date_time),line, count() from entry group by strftime('%Y-%m-%dT%00:00:00.000', date_time)

select strftime('%Y-%m-%dT%H:00:00.000', date_time),line, count() from entry group by strftime('%Y-%m-%dT%H:00:00.000', date_time)

How do I开发者_运维知识库 group by 10 minutes interval


 select ... from entry
 group by strftime('%Y%m%d%H0', date_time) + strftime('%M', date_time)/10;
0

精彩评论

暂无评论...
验证码 换一张
取 消