Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Like clause queries
>>>>> "Sam" == Sam <samevan_at_hotmail.com> writes:
Sam> Tim X <timx_at_spamto.devnul.com> wrote in message Sam> news:<87el7bphtk.fsf_at_tiger.rapttech.com.au>...
Sam> Thank you for reply
Sam> Have to use LIKE because the field is in a long string. By the Sam> way it should be T1.T1_Field2 = '%depname%';
Sam> The question here is how to join two queries with LIKE clause
Sam> subqueries??? any ideas?
Well....
I guess you could use a sub-query. Something like
select *
from t2
where t2.field1 in (select t1.field1
from t1 where t1.field2 like '%depname%');
but its going to be very inefficient. Apart from doing the sub-select for each row in t2, its going to be a full table scan everytime because your '%depname%' is going to mean no index lookups. However, I think you should still be able to do it as a join, unless I've missed soemthing.
-- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out!Received on Sat Jan 18 2003 - 16:37:31 CST