Subject | Re: [firebird-support] Derived Table / Embedded Select.. Help |
---|---|
Author | Alexandre Benson Smith |
Post date | 2007-01-19T22:15:46Z |
Alexandre Benson Smith wrote:
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
> Give a try to this one:Another option:
>
> 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 !
>
>
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