Re: Question regarding new windowing functions in 8.4devel

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Question regarding new windowing functions in 8.4devel
Date: 2009-01-16 17:34:34
Message-ID: 8279.1232127274@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

David Fetter <david(at)fetter(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2009-01-16 17:38:21 Re: [HACKERS] Question regarding new windowing functions in 8.4devel
Previous Message David Fetter 2009-01-16 17:33:06 Re: [HACKERS] Re: Question regarding new windowing functions in 8.4devel

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-16 17:35:55 Re: FWD: Re: Updated backslash consistency patch
Previous Message David Fetter 2009-01-16 17:33:06 Re: [HACKERS] Re: Question regarding new windowing functions in 8.4devel