Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 55A4263865D for ; Wed, 18 Nov 2009 15:15:07 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 42893-07-2 for ; Wed, 18 Nov 2009 19:14:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.210.181]) by mail.postgresql.org (Postfix) with ESMTP id 2201D63549D for ; Wed, 18 Nov 2009 15:12:39 -0400 (AST) Received: by yxe11 with SMTP id 11so1267076yxe.15 for ; Wed, 18 Nov 2009 11:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=0yPZGBrztjTxcZUoWsN3ODxop88uyYxKGwUDoghbVDY=; b=aSit8DQyrGpkASbyOFbsxEjRIdz/N8LzZWR53WNPLPW+yObIQY4JzPkp4nmB4eHTlT v0ZDqoy2XBh3SZtH1cR3F4wGVybAo4fgd0/onnBdqDJZnltJV2vghnookhRMvlBJAzEq SiKRVMBiyawhn476GObj4J32t3fkOXj8LG8No= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=pTnnp7T17msptU7z5NxySdYA4NtxvUOoCNoPILQNPNiUMxpfG+OPc+1YRhTK4yXJ9F Zm5oAV5bXjI8UHFHay+kXnQnf9tt7kV2wfHgJtZVREuLHwDvdoKje9EIX/LNhZttsunO qvkwgFx+nlIGB2hIzUl10IeqABOHcxayc7qWw= MIME-Version: 1.0 Received: by 10.90.10.40 with SMTP id 40mr2696622agj.85.1258571551925; Wed, 18 Nov 2009 11:12:31 -0800 (PST) Date: Wed, 18 Nov 2009 16:12:31 -0300 Message-ID: Subject: LIMIT BASED ON PERCENT From: Another Trad To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=0016361e88b246e5eb0478aa06d1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.815 tagged_above=-10 required=5 tests=AWL=-1.783, BAYES_05=-1.11, HTML_MESSAGE=0.001, SUBJ_ALL_CAPS=2.077 X-Spam-Level: X-Archive-Number: 200911/49 X-Sequence-Number: 33400 --0016361e88b246e5eb0478aa06d1 Content-Type: text/plain; charset=ISO-8859-1 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) --0016361e88b246e5eb0478aa06d1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 clie= nt limit 20%
I have tried (of course, with no success) this:
select *= from client limit ((select count(*) from client)*20/100)
--0016361e88b246e5eb0478aa06d1--