Re: Return 30% of results?

From: nick <nboutelier(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Return 30% of results?
Date: 2009-09-19 07:27:10
Message-ID: 8e09b25e-4364-4cef-8a81-f0bc13864f0d@e4g2000prn.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sep 18, 3:40 pm, spam_ea(dot)(dot)(dot)(at)gmx(dot)net (Thomas Kellerer) wrote:
> 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
>
> --
> Sent via pgsql-general mailing list (pgsql-gene(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

Yeah, im actually not using 8.4. Any other alternatives?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message chris_watcher 2009-09-19 08:44:16 Re: Regarding initdb & pg_ctl
Previous Message Clodoaldo Neto 2009-09-19 01:38:05 Re: MD5 sum mismatch in source rpm