Re: LIMIT BASED ON PERCENT

From: Another Trad <anothertrad(at)gmail(dot)com>
To: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: LIMIT BASED ON PERCENT
Date: 2009-11-18 19:24:09
Message-ID: af7271950911181124i2a309729q2271d9f878e42f3d@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

No, It doesn't.
In my machine:

First select
ERROR: syntax error at end of input
LINE 1: select * from rapadura.cliente limit 20%
^
Second one:
ERROR: argument of LIMIT must not contain subqueries

Postgres 8.3

2009/11/18 Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)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(at)gmail(dot)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
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Guillaume Lelarge 2009-11-18 19:27:08 Re: LIMIT BASED ON PERCENT
Previous Message Lee Hachadoorian 2009-11-18 19:21:06 Re: LIMIT BASED ON PERCENT