On Fri, Jan 16, 2009 at 12:34:34PM -0500, Tom Lane wrote:
David Fetter da...@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
David Fetter da...@fetter.org writes:
We don't appear to be able to use the actual thing in the target list
either.
Would you translate that into English? Or at least an example without
trivial syntax errors?
regards, tom lane
--
Sent via pgsql-general mailing list
On Fri, Jan 16, 2009 at 12:41:59PM -0500, Tom Lane wrote:
David Fetter da...@fetter.org writes:
We don't appear to be able to use the actual thing in the target list
either.
Would you translate that into English? Or at least an example without
trivial syntax errors?
This works:
SELECT
David Fetter da...@fetter.org writes:
Basically, there is no way I've found so far to qualify any window
function in the target list, which makes a giant POLA violation.
The FM points out in at least two places that window functions logically
execute on the output of the WHERE/GROUP BY/HAVING