FW: reg:Query - Mailing list pgsql-admin

From Andy Shellam
Subject FW: reg:Query
Date
Msg-id !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAAC4AAAAAAAAAt+qV6pqKPEmXG74TlFgX5gEAlpDSN+DrMEWnumhoRHpQKQAAAbLc9wAAEAAAABbZZZcyWK9Gh5zBvUODuY0BAAAAAA==@mailnetwork.co.uk
Whole thread Raw
List pgsql-admin

Actually, just realized, this depends on your PGSQL version. 

 

The older format (pre-8.0 I believe) is SELECT ….. LIMIT x, y  (where x is the number of rows to fetch, and y is the offset (ie. Select x number of rows, starting from row y.)

 

Andy

 


From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Andy Shellam
Sent: 16 May 2006 1:57 pm
To: 'sandhya'
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] reg:Query

 

SELECT ….. LIMIT 1

 

Will get the first row in the dataset.  Then to fetch the next row, you can do SELECT …… LIMIT 1 OFFSET 1 (will get the 2nd record) and so on.

(replace ….. with your conditions, LIMIT must come at the end of the query)

 

Andy

 


From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of sandhya
Sent: 16 May 2006 11:47 am
To: Postgres
Cc: sandhya
Subject: [ADMIN] reg:Query

 

Hi

 Is there any query for possibility of getting only one row at a time in a group of records?

 

With distinct rows & Columns my query has to return only one record at a time with out any condition.Will it be possible?

 

Thank you,

Sandhya

 

 

!DSPAM:14,4469cd4d34491667573013!

pgsql-admin by date:

Previous
From: "sandhya"
Date:
Subject: Re: reg:Query
Next
From: "sandhya"
Date:
Subject: Re: reg:Query