Subject Re: [firebird-support] Select records by their position
Author Lester Caine
Magno Machado wrote:
> Hum..
> I thought it work with a range only... F.e., if I want the 2nd, 3rd and 4th
> rows I can use "select first 3 skip 1 .............."
> But if I want the 2nd and 4th only?

How do you 'know' you want the 2nd and 4th record?
In my case they would be, say, the serving times in a transaction table, and
1st and 3rd would be waiting times.
So I
SELECT FIRST 2 .... WHERE (serving flag == 1 in my case ROOM < 30)

When working with relational data you just need to redefine the problem to get
the records you want, and perhaps add fields to provide 'order'. I've had to
add a transaction number to these records so that I can directly select ALL
2nd records for a time period to provide the 'initial serving time' report.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php