我有这个问题
Select week(date_time) week,
sum(X1) as X1,
sum(X2) as X2,
sum(X3) as X3,
sum(X4) as X4
From Fee
Where date_time between '2020-07-01' and current_date
结果如下:
week | X1 | X2 | X3 | X4
27 |
28 |
29 |
30 |
31 |
但我想把结果换成:
week | 27 | 28 | 29 | 30 | 31
X1 |
X2 |
X3 |
X4 |
有人能帮忙吗?
1条答案
按热度按时间55ooxyrt1#
如果我理解了这个问题,您需要取消数据剥离并重新聚合:
普雷斯托还支持
filter
,所以最好写为: