Subject Re: [firebird-support] IN alternative - SOLVED
Author Gary Benade
Problem solved :)

Thanks Helen


> No, it wouldn't, because it's trying to AND in the same cursor.
> Get back to the two-cursor approach but try putting another cursor on
> orderitems_word_match to deal with the circularity in your structure, and
> some brackets to isolate the two AND-ed join tests:
>
> select oi.* from orderitems oi
> join orderitems_word_match ows1
> on ows1.orderitemlink = oi.link
> and
> (exists (
> select 1 from menu_word_search mws1
> where mws1.link = ows1.wordlink
> and mws1.word = 'PITA' ))
> join orderitems_word_match ows2
> on ows2.orderitemlink = oi.link
> and
> (exists (
> select 1 from menu_word_search mws2
> where mws2.link = ows2.wordlink
> and mws2.word = 'CHEESE' ))