Subject Re: [firebird-support] Subqueries and indexes
Author Milan Babuskov
yoav112003 wrote:
> I am trying to run the following query (FB 2 RC3):
>
> SELECT distinct ROWID FROM events
> WHERE events.ROWID IN (
>
> SELECT DISTINCT DESTINATION.EVENTID FROM DESTINATION
> WHERE ( (DESTINATION.IP ='158.125.73.220'))
> )

Try:

SELECT distinct ROWID FROM events e
WHERE EXISTS (
SELECT 1
FROM DESTINATION d
WHERE d.IP ='158.125.73.220'
AND d.EVENTID = e.ROWID)

and tell us how it works.

--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org