Re: Return 30% of results? - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Return 30% of results?
Date
Msg-id h9128b$589$1@ger.gmane.org
Whole thread Raw
In response to Return 30% of results?  (Nick <nboutelier@gmail.com>)
List pgsql-general
Nick wrote on 18.09.2009 23:31:
> Is there a way to return a percentage of the rows found? I tried
> window functions but get an error...
>
> ERROR:  syntax error at or near "OVER"
>
> SELECT id, cume_dist FROM (
>   SELECT id, cume_dist() OVER (ORDER BY id) FROM employees
> ) s
> WHERE cume_dist < 0.3
>
Works for me. Are you sure you are using Postgrs 8.4?
(Windowing functions are not available in earlier versions)

Regards
Thomas

pgsql-general by date:

Previous
From: Nick
Date:
Subject: Return 30% of results?
Next
From: Clodoaldo Neto
Date:
Subject: MD5 sum mismatch in source rpm