On 31 Oct 2001 05:01:45 -0800, Emmanuel.Fabre_at_tangensys.com (Fabre)
wrote:
>Hi,
>
>What is the efficient way to select the 10th row in a table?
>Let's assume, there is no way to select it directly.
>At the moment, I do not see how to avoid to select (and
>fetch depending on the treatment) the first 9 rows.
>Probably, it makes no sense from an sql point of view?
>
>Thanks in advance,
>Emmanuel
You're right ... it makes no sense from an SQL point of view. It only
makes sense from a cursor's point of view, i.e. an SQL select
statement which includes an ORDER BY clause.
In any relational database, record order has no meaning at the table
level. Consider a table as an unordered bucket of data. You retrieve
the data by means of a unique identifier for a specific row, usually
represented by a primary or candidate key which can be composed of one
or more columns.
Think about why you want the 10th row, and not the 9th or the 11th,
and you will come up with some better criteria which will work in a
relational way. You might first need to normalize your table design to
make it work, though.
Received on Sun Nov 04 2001 - 03:48:09 CET