Subject Re: does firebird always go fastest way?
Author martinknappe
ahh, now ic!!!
even though this very query was still not it, i was able to deduce
from it and martijns short example how it should be done

> select, d.whateverfieldsyouwanttooutput
> from dicentries d
> inner join dskrptlink_dicentries link
> on link.id_dicentry =
> inner join dskrpts
> on = link.id_dskrpt
> where dskrpts.asdskrpt in ('abc', 'def', 'ghi')
> group by, d.whateverfieldsyouwanttooutput
> having count(*) >= 3

now, my query looks like this and (and it works ALOT faster than the
one before where i didn't use joins):

select d.*
from dicentries d
inner join dskrptlink_dicentries link1
on link1.id_dicentry =
inner join dskrptlink_dicentries link2
on link2.id_dicentry =
inner join dskrptlink_dicentries link3
on link3.id_dicentry =
inner join dskrpts d1
on = link1.id_dskrpt
inner join dskrpts d2
on = link2.id_dskrpt
inner join dskrpts d3
on = link3.id_dskrpt
where (d1.asdskrpt = 'abc') and (d2.asdskrpt = 'def') and (d3.asdskrpt
= 'ghi')

thanx for that guys