Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Tricky SQL Question
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 Thu Feb 03 2000 - 18:41:47 CST
![]() |
![]() |