Skip site navigation (1) Skip section navigation (2)

Re: Question about restricting the number of rows returned

From: Tuna Chatterjee <tchatter(at)alert(dot)infoplease(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Question about restricting the number of rows returned
Date: 2002-02-20 21:20:03
Message-ID: 1014240003.14226.27.camel@steamer.infoplease.com (view raw or flat)
Thread:
Lists: pgsql-novice
hi steve,

i believe the syntax would be:
"SELECT columns
FROM myTable
WHERE myConditions = conditions
LIMIT 50";

additionally, if you'd want to select rows 51 to 100 i think the last
line would read:
OFFSET 50 LIMIT 50

take care,
tuna chatterjee


On Wed, 2002-02-20 at 15:03, Stephen Ingram wrote:
> 
> 
> Hi,
> 
> If I am running a query I know could return 1000's of rows;
> is there a PG way to say to just return the first, say, 50 rows?
> 
> cheers
> 
> steve
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly



In response to

pgsql-novice by date

Next:From: Jon HassenDate: 2002-02-20 21:57:32
Subject: Adding CLUSTERING removed my indexes
Previous:From: Stephen IngramDate: 2002-02-20 21:17:16
Subject: Re: Question about restricting the number of rows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group