Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: compare two columns (oracle 9i)

Re: compare two columns (oracle 9i)

From: LiShan Cheng <exriscer_at_gmail.com>
Date: Fri, 14 Apr 2006 11:28:09 +0200
Message-ID: <6e9345580604140228x5c315e5bof65a8fc8b92c37fa@mail.gmail.com>


hi

you can use minus or union depending on your requirements to find same rows

On 4/13/06, Bob Robert <mssql_2002_at_yahoo.com> wrote:
>
> Gurus,
>
> I would like to compare two columns from two different tables without
> creating cursor. Is it possible?
>
> create table r1 (col1 varchar2(10));
> create table r2 (col2 varchar2(15));
> insert into r1 values ('TEVE');
> insert into r2 values ('STEVE');
> insert into r1 values ('OM');
> insert into r2 values ('TOM');
> insert into r1 values ('JIM');
> insert into r2 values ('BUSH');
>
> SQL> select col1 from r1;
>
> COL1
> ----------
> TEVE
> OM
> JIM
>
> SQL> select col2 from r2;
>
> COL2
> ---------------
> STEVE
> TOM
> BUSH
>
> SQL> select col2 from r1,r2 where col2 like '%col1%';
>
> no rows selected
>
> Above Query doesn't return any rows?
>
> Thanks
> Bob
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Apr 14 2006 - 04:28:09 CDT

Original text of this message

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