Re: [GENERAL] Question regarding new windowing functions in 8.4devel - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Question regarding new windowing functions in 8.4devel
Date
Msg-id 8279.1232127274@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Question regarding new windowing functions in 8.4devel  (David Fetter <david@fetter.org>)
Responses Re: [GENERAL] Question regarding new windowing functions in 8.4devel  (David Fetter <david@fetter.org>)
List pgsql-hackers
David Fetter <david@fetter.org> writes:
> I tried this:

> SELECT
>     typ,
>     ts,
>     rank() over w AS foo_rank
> FROM
>     foo
>         WINDOW  w AS (partition by typ order by ts desc)
> WHERE
>     foo_rank < 4;

> ERROR:  syntax error at or near "WHERE"
> LINE 8: WHERE
>         ^

RTFM ... WINDOW goes after WHERE (and GROUP BY, HAVING, ...)

Also, we have never allowed SELECT-alias references in WHERE;
window functions have nothing to do with that.

            regards, tom lane

pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Re: [GENERAL] Question regarding new windowing functions in 8.4devel
Next
From: Simon Riggs
Date:
Subject: Re: SnapshotResetXmin