Subject Re: [ib-support] Select SQL
Author Paul Schmidt
On 31 Oct 2001, at 13:52, Sandeep wrote:

> I have a table with field Number as primary key.
> I want to get a record prior to specified number, something like
>
> select * from tableA
> where Number < 1000
>
> I don't know what the previous number is.
>

I have seen a couple of ways, here is the easiest,

SELECT * FROM tableA WHERE Number < 1000 ORDER BY
Number DESC;

The first record you fetch is the one you want, if you want records
before that, then simply keep fetching.

Paul


Paul Schmidt
Tricat Technologies
paul@...
www.tricattechnologies.com