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

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

compare two columns (oracle 9i)

From: Bob Robert <mssql_2002_at_yahoo.com>
Date: Thu, 13 Apr 2006 13:32:09 -0700 (PDT)
Message-ID: <20060413203209.27998.qmail@web38001.mail.mud.yahoo.com>


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 Received on Thu Apr 13 2006 - 15:32:09 CDT

Original text of this message

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