From: Lee Hachadoorian <lee.hachadoorian@gmail.com>
To: Another Trad <anothertrad@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: LIMIT BASED ON PERCENT
Date: Wed, 18 Nov 2009 14:21:06 -0500
Message-ID: <5ab13580911181121g6e89759doa6c6ea6557424f71@mail.gmail.com> (raw)
In-Reply-To: <af7271950911181112h574da17euf94d9640ec7680df@mail.gmail.com>
References: <af7271950911181112h574da17euf94d9640ec7680df@mail.gmail.com>
Your SQL works for me exactly as it is (substituting a table in my
database). What error are you getting?
On Wed, Nov 18, 2009 at 2:12 PM, Another Trad <anothertrad@gmail.com> wrote:
> 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)
>
--
Lee Hachadoorian
PhD Student, Geography
Program in Earth & Environmental Sciences
CUNY Graduate Center
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: lee.hachadoorian@gmail.com, anothertrad@gmail.com
Subject: Re: LIMIT BASED ON PERCENT
In-Reply-To: <5ab13580911181121g6e89759doa6c6ea6557424f71@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