Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Tricky SQL Question

Tricky SQL Question

From: Larry Pettit <larry.pettit_at_ps.net>
Date: Thu, 3 Feb 2000 17:41:47 -0700
Message-ID: <v5pm4.540$SO4.7443@news.uswest.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US