Home » SQL & PL/SQL » SQL & PL/SQL » how do i compare the "char" type column of 2 tables
how do i compare the "char" type column of 2 tables [message #18390] Wed, 30 January 2002 03:59 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,
i have table1 with "name varchar2(100)" as column and has 100 records
i have another table table2 with "name varchar2(100)" as column and has 150 records.

If i give
select count(t1.name) from table1 t1,table2 t2
where t1.name = t2.name

It does not work. Why..There are few matching records in table1 when physically compared with table2
Re: how do i compare the "char" type column of 2 tables [message #18391 is a reply to message #18390] Wed, 30 January 2002 04:07 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
try this if ur db version is 8
select count(t1.name) from table1 t1,table2 t2
where trim(t1.name) = trim(t2.name)

v7 query

select count(t1.name) from table1 t1,table2 t2
where ltrim(rtrim(t1.name)) = ltrim(rtrim(t2.name))
Previous Topic: java.exe exception with oracle 8 on win2k P4
Next Topic: group by group
Goto Forum:
  


Current Time: Tue Aug 11 23:35:57 CDT 2020