标签: sql group-by teradata
我有一个查询(这里更短):
SELECT a,b,c ,SUM(something) as s FROM table GROUP BY 1, 2, 3
假设我在SUM
SUM
是否有一种速记可以省去将1,2,3全部写到23的麻烦?
1,2,3
23
答案 0 :(得分:0)
试试这个
SELECT DISTINCT a,b,c ,SUM(something) OVER(partition by a,b,c) as s FROM table