Re: LIMIT BASED ON PERCENT - Mailing list pgsql-sql

From Lee Hachadoorian
Subject Re: LIMIT BASED ON PERCENT
Date
Msg-id 5ab13580911181133k6204bbb0h33a695e618bfa02b@mail.gmail.com
Whole thread Raw
In response to Re: LIMIT BASED ON PERCENT  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: LIMIT BASED ON PERCENT  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-sql
On Wed, Nov 18, 2009 at 2:30 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> yes, and don't use 20%.
>
> select * from foo order by somecol limit (select (count(*)*0.2)::int from foo)
>
> Regards
> Pavel

Is this faster on a large table? Because (select (count(*)*20/100)) worked fine.


pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: LIMIT BASED ON PERCENT
Next
From: Pavel Stehule
Date:
Subject: Re: LIMIT BASED ON PERCENT