X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 99E4352863 for ; Mon, 27 Jun 2005 15:32:36 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70556-10 for ; Mon, 27 Jun 2005 18:32:35 +0000 (GMT) Received: from n6.gigared.com (smtp1.gigared.com [200.68.216.6]) by svr1.postgresql.org (Postfix) with ESMTP id F21295284D for ; Mon, 27 Jun 2005 15:32:33 -0300 (ADT) Received: from [10.41.138.237] (unknown [10.41.138.237]) by n6.gigared.com (Postfix) with ESMTP id 66F9C10A93; Mon, 27 Jun 2005 14:12:45 -0300 (GMT) From: =?utf-8?q?Mart=C3=ADn_Marqu=C3=A9s?= To: Markus Bertheau =?utf-8?q?=E2=98=AD?= Subject: Re: SELECT * FROM foo OFFSET -1 LIMIT 1 Date: Mon, 27 Jun 2005 14:17:28 -0300 User-Agent: KMail/1.7.1 Cc: pgsql-sql@postgresql.org References: <1119886449.29687.3.camel@dicaprio.akademie1.de> In-Reply-To: <1119886449.29687.3.camel@dicaprio.akademie1.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200506271417.28851.martin@bugs.unl.edu.ar> X-Gigared-MailScanner-Information: MailScanner: Found to be clean X-MailScanner-From: martin@bugs.unl.edu.ar X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.636 tagged_above=0 required=5 tests=INVALID_TZ_GMT X-Spam-Level: X-Archive-Number: 200506/319 X-Sequence-Number: 21920 El Lun 27 Jun 2005 12:34, Markus Bertheau =E2=98=AD escribi=C3=B3: > Hi, >=20 > is there a reason that >=20 > SELECT * FROM t1 OFFSET -1 LIMIT 1 >=20 > does not return 0 rows? Accordingly >=20 > SELECT * FROM t1 OFFSET -1 LIMIT 2 >=20 > should return 1 row, imo. =46rom the docs: The LIMIT clause consists of two independent sub-clauses: LIMIT { count | ALL } OFFSET start count specifies the maximum number of rows to return, while start specifies= =20 the number of rows to skip before starting to return rows. When both are=20 specified, start rows are skipped before starting to count the count rows t= o=20 be returned. How do you skip -1 rows? =2D-=20 select 'mmarques' || '@' || 'unl.edu.ar' AS email; =2D-------------------------------------------------------- Mart=C3=ADn Marqu=C3=A9s | Programador, DBA Centro de Telem=C3=A1tica | Administrador Universidad Nacional del Litoral =2D--------------------------------------------------------