Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: tricky SQL Question
Here's some more information. I want to build a dynamic text search engine.
The more keywords they enter will help define the product. Each product
description may contain 10 words that will be broken apart as keywords with
a pointer back to the product. The more words they enter, the fewer
products that will be returned. For example;
bat is associated with products 1, 2 wood bat is only associated with product 1
I can build this with a self join or subquery but it is a lot of work to do dynamically based on the user input. For each keyword they enter it takes it down a level. Anybody have a better solution.
Larry Pettit wrote in message ...
>Given the following table/columns;
>
> product_number keyword
>----------------------- ------------
> 1 bat
> 1 wood
> 1 large
> 2 bat
> 2 metal
>
>I want to do a lookup where I get a match based on the number of words
>entered. For example I know that a self join, or subquerry would work but
I
>would have to add a level or table for each keyword.
>For example;
>
> select t1.product
> from product_lookup t1,
> product_lookup t2
> where t1.keyword = 'wood' and
> t2.keyword = 'bat' and
> t1.product = t2.product
>
> PRODUCT
>--------
> 1
>
>Anybody have a solution that works recursively for any number of keywords?
>
>Thanks
>
>
Received on Fri Feb 04 2000 - 09:54:20 CST
![]() |
![]() |