X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3AEC69DCB4C for ; Wed, 22 Feb 2006 05:21:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79707-01 for ; Wed, 22 Feb 2006 05:21:10 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E1D719DCB5E for ; Wed, 22 Feb 2006 05:21:06 -0400 (AST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by svr4.postgresql.org (Postfix) with ESMTP id 345325AF02E for ; Wed, 22 Feb 2006 09:21:09 +0000 (GMT) Received: from [213.162.97.75] (helo=mail.metronet.co.uk) by ptb-relay03.plus.net with esmtp (Exim) id 1FBqBG-0004RR-IG; Wed, 22 Feb 2006 09:21:06 +0000 Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 6B92140D4C4; Wed, 22 Feb 2006 09:18:28 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 277C215EA6; Wed, 22 Feb 2006 09:18:28 +0000 (GMT) Message-ID: <43FC2C63.8000006@archonet.com> Date: Wed, 22 Feb 2006 09:18:27 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: padmanabha konkodi Cc: pgsql-sql@postgresql.org Subject: Re: restircting rows References: <20060222090657.17853.qmail@webmail49.rediffmail.com> In-Reply-To: <20060222090657.17853.qmail@webmail49.rediffmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.118 required=5 tests=[AWL=0.118] X-Spam-Score: 0.118 X-Spam-Level: X-Archive-Number: 200602/260 X-Sequence-Number: 24270 padmanabha konkodi wrote: > > > hi all, > > my query return 100 rows but if i am intrested only from 40-60 rows > then how to restrict. > > for example > > select * from students (returns 100 rows).but i am intrested only > rows from 40 to 60. SELECT * FROM student ORDER BY something LIMIT 20 OFFSET 40; Be aware that this will have to fetch 60 rows and throw the first 40 away. -- Richard Huxton Archonet Ltd