Re: help on SQL - Mailing list pgsql-interfaces

From Bruno Wolff III
Subject Re: help on SQL
Date
Msg-id 20040421175154.GA30712@wolff.to
Whole thread Raw
In response to Re: help on SQL  (Gergely Czuczy <phoemix@harmless.hu>)
List pgsql-interfaces
On Wed, Apr 21, 2004 at 12:21:32 +0200, Gergely Czuczy <phoemix@harmless.hu> wrote:
> hello
> 
> what you have done is not the thing that was asked. you've retrieved every
> row that has a spacial value(data-1 %3). the request was to retrieve every
> 3rd row. the difference is that, the 'every Nth' row has nothing to do
> with the value of any field in the row. try to retrieve every Nth row from
> a query where there are no integer values, only timestamps and string. or
> try to do your method where the integer value is not continous.

Rows do not have any order. Unless you define the ordering you want in terms
of same data in the rows there is no every other row.

If you can order the rows (no randomly breaking ties) then you can get
the number of the row in this ordering (though not by a very efficient
method) and select rows based on the this number.


pgsql-interfaces by date:

Previous
From: Michael Stephenson
Date:
Subject: Re: help on SQL
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: Everything broke