Re: Extracting superlatives - SQL design philosophy - Mailing list pgsql-performance

From Tom Lane
Subject Re: Extracting superlatives - SQL design philosophy
Date
Msg-id 2798.1267108966@sss.pgh.pa.us
Whole thread Raw
In response to Re: Extracting superlatives - SQL design philosophy  ("Julien Theulier" <julien@squidsolutions.com>)
List pgsql-performance
"Julien Theulier" <julien@squidsolutions.com> writes:
> Teradata provides a �qualify� syntax which works as a filtering condition on
> a windowed function result. This is the only DB allowing this direct
> filtering on windowed functions, from what I know.

Seems like you could easily translate that into SQL-standard syntax by
adding a level of sub-select:

    select ... from (select *, window_function wf from ...) ss
    where wf=1;

            regards, tom lane

pgsql-performance by date:

Previous
From: "Julien Theulier"
Date:
Subject: Re: Extracting superlatives - SQL design philosophy
Next
From: Yu-Ju Hong
Date:
Subject: dbt2 performance