Return 30% of results?

From: Nick <nboutelier(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Return 30% of results?
Date: 2009-09-18 21:31:29
Message-ID: 4b9921d4-a186-40b5-8c74-e8ada71fa3f1@y28g2000prd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Bailey 2009-09-18 21:50:33 Re: haversine formula with postgreSQL
Previous Message Greg Smith 2009-09-18 20:51:05 Re: haversine formula with postgreSQL