Re: Return 30% of results?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Return 30% of results?
Date: 2009-09-18 22:40:11
Message-ID: h9128b$589$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo Neto 2009-09-18 22:42:19 MD5 sum mismatch in source rpm
Previous Message vikram 2009-09-18 22:21:02 Re: PostgreSQL on Windows Server 2003 for Moodle