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 -> Re: Combine Queries with LIKE Clause

Re: Combine Queries with LIKE Clause

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 19 Jan 2003 12:05:39 GMT
Message-ID: <b0e4ai$nd85p$1@ID-82536.news.dfncis.de>

> I have two queries:
>
> select deptname from table1 (return 3 rows)
>
> select saleman from table2 where dept_desc LIKE '%table1.deptname%' (repeat 3 times)
>
> How to combine them together?

I can only guess what you want as you don't provide me with more details on your tables and where conditions. That said, I am inclined to think that you wanted the following:

select
  t1.deptname, t2.saleman
from
  table1 t1, table2 t2
where
  t2.dept_desc like '%' || t1.deptname || '%';

Rene

-- 
  no sig today
Received on Sun Jan 19 2003 - 06:05:39 CST

Original text of this message

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