Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 255D5632ADB for ; Wed, 18 Nov 2009 15:24:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01549-01 for ; Wed, 18 Nov 2009 19:24:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f198.google.com (mail-yw0-f198.google.com [209.85.211.198]) by mail.postgresql.org (Postfix) with ESMTP id 06BF16329B9 for ; Wed, 18 Nov 2009 15:24:13 -0400 (AST) Received: by ywh36 with SMTP id 36so1344875ywh.15 for ; Wed, 18 Nov 2009 11:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=nMHncrts3acPG4DM4yRyN8fdPD4fml6TIDfqyhYGH/A=; b=TGhm9PM97j+J5q/bxwWJ76EsBJzL2ljEQeDPUMXg/sK4wvC7NWIKHzrDy9O4jREVfG DfzRZeQtZxSZl8HdEuRE9JRRImKYX7dW8mPaKuE5BzBfjSnXC9OYzxitxpIWzHXi1DDI s9PS0pF5fYQMUzfoiaP94TsgNMLr8BjnH348E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=JTD65ggUemX67TFW2VoQcejv1nbYtR6Ers89Wsq24IrQRgJYrZw17zje77TYaOxGl8 KXpdagPCQgUn1gZH6rbH7nq42TpEOeykcguzxBAPGdebcYziV8fRwKK6aThdwZzdmbmh nZy/Nfdw/qP+2Yvr853Hi+WMoaHxy9oHkAZ+c= MIME-Version: 1.0 Received: by 10.90.255.1 with SMTP id c1mr2715006agi.115.1258572249871; Wed, 18 Nov 2009 11:24:09 -0800 (PST) In-Reply-To: <5ab13580911181121g6e89759doa6c6ea6557424f71@mail.gmail.com> References: <5ab13580911181121g6e89759doa6c6ea6557424f71@mail.gmail.com> Date: Wed, 18 Nov 2009 16:24:09 -0300 Message-ID: Subject: Re: LIMIT BASED ON PERCENT From: Another Trad To: Lee Hachadoorian Cc: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=001636283f38e0bba30478aa2f58 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.739 tagged_above=-10 required=5 tests=BAYES_20=-0.74, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200911/51 X-Sequence-Number: 33402 --001636283f38e0bba30478aa2f58 Content-Type: text/plain; charset=ISO-8859-1 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 > 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 > 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 > --001636283f38e0bba30478aa2f58 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable No, It doesn't.
In my machine:

First select
ERROR:=A0 syntax error at end of inpu= t
LINE 1: select * from rapadura.cliente l= imit 20%
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ^
Second one:
ERROR:=A0 argument of LIM= IT must not contain subqueries

Postgres 8.3

2009/11/18 Lee Hachadoor= ian <lee= .hachadoorian@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

--001636283f38e0bba30478aa2f58--