gpt4 book ai didi

Android SQLite - 是否可以检索按周/月分组的数据?

转载 作者:行者123 更新时间:2023-11-29 17:46:05 26 4
gpt4 key购买 nike

我有一个如下所示的 SQLite 表

Column1      :  Detail
2014-10-07 : 5
2014-10-09 : 5
2014-10-14 : 6
2014-10-15 : 6
2014-10-22 : 7
2014-10-23 : 7

我想检索按周分组的详细列值(周可以是任何 - 周日到周日或任何)。

结果应该是 10,12,14。如果星期五是周末。

这在 SQLite 中是否可以通过任何查询实现?

最佳答案

试试这个查询

SELECT  sum(detail)'calculatedvalue'  FROM Test group by STRFTIME('%W', date);

在此数据上测试

enter image description here

查询输出

enter image description here

关于Android SQLite - 是否可以检索按周/月分组的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26623093/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com