>>For a given order of rows in a SQL Server table ( I.e. the natural order or the order an ORDER BY clause would generate ), is it possible to
efficiently query the Nth row in the table?
>>
>>Thanks,
>>Bill
>
>Incomplete and Not extremely efficient:
>
>SELECT TOP 1 * FROM
> (SELECT TOP N * FROM TABLE1 ORDER BY clause) X ORDER BY clause DESC
>
Hi Fabio,
Thanks. Yes, I came up with something similar to this. Will work ok for smaller tables but as you mentioned, becomes expensive for larger tables. That's why I added the "efficient" qualifier. :-) But there doesn't seem to be a simple solution to this without using an auxiliary work table.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.