Subject Re: [firebird-support] Derived Table / Embedded Select.. Help
Author Alexandre Benson Smith
Alexandre Benson Smith wrote:
> Give a try to this one:
>
> Select
> p.*
> From
> Product P
> where
> exists (select
> 1
> from
> KeywordKeyProductKey kkpk join
> KeyWord kw on (kw.KeywordKey = kkpk.KeywordKey)
> where
> kw.Keyword like 'LAMP%' and
> kkpk.ProductKey = P.ProductKey) and
> exists (select
> 1
> from
> KeywordKeyProductKey kkpk join
> KeyWord kw on (kw.KeywordKey = kkpk.KeywordKey)
> where
> kw.Keyword like 'FLOURESCENT%' and
> kkpk.ProductKey = P.ProductKey)
>
>
> see you !
>
>

Another option:

Select
p.*
From
Product P join
KeywordKeyProductKey kkpk1 on (kkpk1.ProdutoKey = P.ProductKey) join
KeyWord kw1 on (kw1.KeywordKey = kkpk1.KeyWordKey) join
KeywordKeyProductKey kkpk2 on (kkpk2.ProdutoKey = P.ProductKey) join
KeyWord kw2 on (kw2.KeywordKey = kkpk2.KeyWordKey)
where
kw1.Keyword like 'LAMP%' and
kw2.Keyword like 'FLOURESCENT%'


see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br