List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:January 27 2005 2:30pm
Subject:Re: How to select every second record
View as plain text  
Hello,

> Is it possible to select only every second record from a record set?
>
> I should select the record-number 1, 3, 5, 7, 9, ... or record-number 2,
4,
> 6, 8, ...
>
> Can this be done with LIMIT?

Besides the obvious "why?" ...

A table, by itself, does not have "every second record", as it has
particular
order of records.

A resultset of rows (being a selection of records from one or more tables)
doesn't have a specific order, unless you tell it to have one.

Only getting every 2nd row of a resultset, IMO, would be much easier
by doing that on the client side.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com

Thread
How to select every second recordMartin Rytz27 Jan
  • Re: How to select every second recordMartijn Tonies27 Jan
RE: How to select every second recordJay Blanchard27 Jan
RE: How to select every second recordJay Blanchard27 Jan
  • RE: How to select every second recordGordon27 Jan
RE: How to select every second recordJay Blanchard27 Jan