Top "Window-functions" questions

A window function is a type of SQL operation that aggregates over a partition of the result set.

Applying Multiple Window Functions On Same Partition

Is it possible to apply multiple window functions to the same partition? (Correct me if I'm not using the right …

sql postgresql window-functions
SQL window function with a where clause?

I'm trying to correlate two types of events for users. I want to see all event "B"s along with …

sql postgresql window-functions
Filtering by window function result in Postgresql

Ok, initially this was just a joke we had with a friend of mine, but it turned into interesting technical …

sql postgresql window-functions
Postgres window function and group by exception

I'm trying to put together a query that will retrieve the statistics of a user (profit/loss) as a cumulative …

sql postgresql aggregate-functions window-functions
How to aggregate over rolling time window with groups in Spark

I have some data that I want to group by a certain column, then aggregate a series of fields based …

sql apache-spark pyspark apache-spark-sql window-functions
Partitioning by multiple columns in Spark SQL

With Spark SQL's window functions, I need to partition by multiple columns to run my data queries, as follows: val …

apache-spark apache-spark-sql window-functions
What is the difference between rowsBetween and rangeBetween?

From the PySpark docs rangeBetween: rangeBetween(start, end) Defines the frame boundaries, from start (inclusive) to end (inclusive). Both start …

sql apache-spark pyspark apache-spark-sql window-functions
SPARK SQL Equivalent of Qualify + Row_number statements

Does anyone know the best way for Apache Spark SQL to achieve the same results as the standard SQL qualify() + …

sql apache-spark apache-spark-sql window-functions row-number
How to use a SQL window function to calculate a percentage of an aggregate

I need to calculate percentages of various dimensions in a table. I'd like to simplify things by using window functions …

sql postgresql aggregate-functions window-functions greenplum
Why do I need to apply a window function to samples when building a power spectrum of an audio signal?

I have found for several times the following guidelines for getting the power spectrum of an audio signal: collect N …

audio signal-processing fft spectrum window-functions