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: Sam <samevan_at_hotmail.com>
Date: 19 Jan 2003 08:55:42 -0800
Message-ID: <35a7dd54.0301190855.3014dcb3@posting.google.com>


DA Morgan <damorgan_at_exesolutions.com> wrote in message news:<3E298ACE.DC64C844_at_exesolutions.com>...
> Sam wrote:
>
> > 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?
>
> Likely the problem is that you have created a Cartesian join. But without seeing your
> SQL it is impossible to know.
>
> Daniel Morgan

Thank you Daniel! Here are the queries and their results 1.
select deptname from table1 (return 3 rows)

returns three deptname

management
sale
engineer

2.

select saleman from table2 where dept_desc LIKE '%management%'

returns

Amy
Tony

note: table2 is directly converted from mainframe dept_desc field looks like "0056894_xxxx_management_line_435....."

select saleman from table2 where dept_desc LIKE '%sale%'

returns

Sreve
Tony
...

select saleman from table2 where dept_desc LIKE '%engineer%'

returns

David
... Received on Sun Jan 19 2003 - 10:55:42 CST

Original text of this message

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