Position to records in Firebird database lazarus / 16-Databases ---------------------------------------------------------------------- finalist · 2009-11-04 18:20 For example: there are 100 records in a Firebird database. I do execute the SQLQuery: 'select W from TRIANGLE order by W asc' I need to position to 50 and 51 record and get the average value of both But the record count may to be 2, 3, 4 .... Is there some solution for this ? Thank you ! ---------------------------------------------------------------------- bluewolf · 2009-11-04 20:55 Hi finalist, I had to check on the internet as I don't use Firebird. You shoud try with: 'select first 2 skip 49 W from TRIANGLE order by W asc' According to firebird documentation here it should work. You can check the link. There are several examples about it. I hope it helps. Regards. Alberto. ---------------------------------------------------------------------- finalist · 2009-11-04 21:04 Thanks bluewolf ! Your solution works fine for me !