Re: help on SQL

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Gergely Czuczy <phoemix(at)harmless(dot)hu>
Cc: Michael Stephenson <mstephenson(at)tirin(dot)openworld(dot)co(dot)uk>, Kenneth Suralta <ksuralta(at)ntsp(dot)nec(dot)co(dot)jp>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: help on SQL
Date: 2004-04-21 17:51:54
Message-ID: 20040421175154.GA30712@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Wed, Apr 21, 2004 at 12:21:32 +0200,
Gergely Czuczy <phoemix(at)harmless(dot)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.

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Greg Sabino Mullane 2004-04-21 22:03:15 Re: Everything broke
Previous Message Michael Stephenson 2004-04-21 10:38:25 Re: help on SQL