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: Like clause queries

Re: Like clause queries

From: Sam <samevan_at_hotmail.com>
Date: 17 Jan 2003 14:57:54 -0800
Message-ID: <35a7dd54.0301171457.7443f8d8@posting.google.com>


DA Morgan <damorgan_at_exesolutions.com> wrote in message news:<3E284FEB.A787B50E_at_exesolutions.com>...
> Sam wrote:
>
> > I have two queries
> >
> > select T1_Field1 from T1 where T1_Field2 like "deptname"
> >
> > select * from T2 where T2_Field2 like T1_Field1
> >
> > Is there anyway to combine these two queries to one?
>
> No.
>
> One query selects a single field. The other, I presume, multiple fields.
>
> If the fields were the same in terms of datatype and number you could
> use UNION or UNION ALL
>
> But with respect to your first query you can do:
> LIKE "deptname"
>
> It is either
> = 'deptname'
> or it is
> LIKE '%deptname%'
>
> Daniel Morgan

You are right, it should use LIKE '%deptname%' If there is no way to combone these two queries into one. Can we write this two queries in a stored procedure? Received on Fri Jan 17 2003 - 16:57:54 CST

Original text of this message

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