2021年1月22日星期五

Window functions: How to partition over nothing?

I am extracting a table, but I would also like the sum of a column.

I can say SUM(column) over (partition by other_column)

to get a new column with a sum over the column for every grouping given by other_column.

But I don't want a grouping! Basically sum(column) is meant to give me a column with a constant row equal to the sum of the entire column with no partitioning.

So how do I partition over nothing?

https://stackoverflow.com/questions/65791960/window-functions-how-to-partition-over-nothing January 19, 2021 at 08:56PM

没有评论:

发表评论