...
Tip | ||
---|---|---|
| ||
(select sum(纯收入) from 测试数据 A where A.省份=测试数据.省份 and A.周=printf('%d周', case when cast(strftime('%j', 测试数据.日期) as int) > 300 and cast(strftime('%W', date(测试数据.日期,'+2 day', 'localtime')) as int) < 2 then '53' else strftime('%W', date(测试数据.日期,'+2 day', 'localtime')) end -1 ) ) |
(注:本例中的周计算是按本周六至下周五算一周)