Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Combine Queries with LIKE Clause
> 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 todayReceived on Sun Jan 19 2003 - 06:05:39 CST
![]() |
![]() |