Skip to content

support FILTER clause in window functions with an OVER clause #1006

@lovasoa

Description

@lovasoa

The way the filter clause is currently implemented seems buggy, and fails to parse expressions like

select max(x) filter(where y) over () from t

which is valid in SQLite and postgres

For instance, the following returns 4 in both postgres and sqlite:

select max(column1) filter (where column1 % 2 = 0) from (values (1),(2),(3),(4),(5)) t

See the FILTER clause on modern-sql.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions