6 messages in com.mysql.lists.win32String Comparison
FromSent OnAttachments
XposEx21 Nov 2004 08:18 
Graeme St.Clair23 Nov 2004 17:44 
Petr Vileta23 Nov 2004 20:00 
Graeme St.Clair24 Nov 2004 09:19 
Randy Clamons24 Nov 2004 11:22 
Graeme St.Clair24 Nov 2004 14:49 
Subject:String Comparison
From:Graeme St.Clair (grae@atlanticbb.net)
Date:11/23/2004 05:44:09 PM
List:com.mysql.lists.win32

I have a curious problem which I think must have something to do with comparing VARCHAR's.

I have two tables, each with an XXX VARCHAR(30). I have LOAD'ed one row into each table from a tab-delimited flat file. XXX is 701 in both tables. The only difference is that in T1, XXX is a column in the middle of the row, but in T2, it is the last column. Then:-

SELECT T1.A FROM T1, T2 WHERE ( T1.XXX = 701 AND T2.XXX = 701 );

shows the one row from T1 just fine. And:-

SELECT T1.A FROM T1, T2 WHERE ( T1.XXX = T1.XXX );

shows the one row from T1 just fine. But:-

SELECT T1.A FROM T1, T2 WHERE ( T1.XXX = T2.XXX );

shows an empty set. Huh?

Rgds, GStC.