Implement FILTER-clause for aggregate functions [CORE5768] #6031
Submitted by: @mrotteveel
Implement FILTER-clause for aggregate functions (introduced in SQL:2003). This syntax allows for filtering before aggregation.
SUM(<expression>) FILTER(WHERE <condition>)
or with window functions:
SUM(<expression>) FILTER(WHERE <condition>) OVER (<window>)
Workarounds/alternative: use a CASE-expression within the aggregate function.
See also SQL:2016 10.9 <aggregate function> and https://modern-sql.com/feature/filter
The text was updated successfully, but these errors were encountered: