I'm working on a mysql server 5.0.45 hosted on linux RHEL 5.0.
1. I've 2-tables as below:
table1:
acct_no VARCHAR(15)
column1 varchar(10)
table2:
acct_no VARCHAR(12)
column2 varchar(10)
In both the tables, there are many rows with identical A/c nos.
2. Of the below 2-queries, only the second one works.
SELECT a.acct_no,a.column1,b.column2
FROM table1 a, table2 b
WHERE trim(a.acct_no) = trim(b.acct_no)
SELECT a.acct_no,a.column1,b.column2
FROM table1 a, table2 b
WHERE a.acct_no*1 = b.acct_no*1
Why does varchar matching fail whereas numeric operation works?