From: Another Trad <anothertrad@gmail.com>
To: pgsql-sql@postgresql.org
Subject: LIMIT BASED ON PERCENT
Date: Wed, 18 Nov 2009 16:12:31 -0300
Message-ID: <af7271950911181112h574da17euf94d9640ec7680df@mail.gmail.com> (raw)
My question is quite simple: I want to select all the records from my table,
but I want apply a LIMIT of 20% in the lines. like:
select * from client limit 20%
I have tried (of course, with no success) this:
select * from client limit ((select count(*) from client)*20/100)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: anothertrad@gmail.com
Subject: Re: LIMIT BASED ON PERCENT
In-Reply-To: <af7271950911181112h574da17euf94d9640ec7680df@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox