Subject For Loop
Author Mike Grover
Hi all, My UDF Function for Distance works wondefull with Firebird 1 Beta 2

I have a little different question?


Is there a way to do some kind of loop with Ib SQL to
keep querying records and adding them to a result set?

what I want to do is, Query for some records between a certain lat and long
like:

SELECT * FROM EXPERIAN WHERE LATITUDE BETWEEN 'xxxxxxxxx' AND 'xxxxxxxxx'
AND
LONGITUDE BETWEEN 'xxxxxxxxx' AND 'xxxxxxxxx'


I I don't get enough

I would like to query a second distance band and have them merged with
the previous set ( with out having to requery first band)? may not be
possible?

I tested a query like this and there was no speed degredation.

SELECT * FROM EXPERIAN WHERE
(LATITUDE BETWEEN 'xxxxxxxxx' AND 'xxxxxxxxx')
OR
(LATITUDE BETWEEN 'xxxxxxxxx' AND 'xxxxxxxxx')
AND
(LONGITUDE BETWEEN 'xxxxxxxxx' AND 'xxxxxxxxx'
OR
(LONGITUDE BETWEEN 'xxxxxxxxx' AND 'xxxxxxxxx')

thanks, mike