SELECT
CONCAT(CAST(WEEK(CAST(date as DATE)) as VARCHAR), ' - WEEK') as week,
COUNT(DISTINCT(field1)) as field1_count,
SUM(amount) as amount
FROM table
WHERE SUBSTR(DATE, 1, 4) = '2020'
GROUP BY 1
ORDER BY 1
有没有办法确保这里的总量 Sun - Sat
? 当前正在聚合 Mon - Sun
1条答案
按热度按时间ruoxqz4g1#
给日期加上一天: