Re: compare two columns (oracle 9i)

  • From: "LiShan Cheng" <exriscer@xxxxxxxxx>
  • To: mssql_2002@xxxxxxxxx
  • Date: Fri, 14 Apr 2006 11:28:09 +0200

hi

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


On 4/13/06, Bob Robert <mssql_2002@xxxxxxxxx> 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
> --
> //www.freelists.org/webpage/oracle-l
>
>
>

Other related posts: