LIMIT BASED ON PERCENT

From: Another Trad <anothertrad(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: LIMIT BASED ON PERCENT
Date: 2009-11-18 19:12:31
Message-ID: af7271950911181112h574da17euf94d9640ec7680df@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Lee Hachadoorian 2009-11-18 19:21:06 Re: LIMIT BASED ON PERCENT
Previous Message Another Trad 2009-11-18 17:37:17 Re: need nelp with aggregate functions