Do you seriously have a column named "0020,0032" ?!!? And don't even get me started on the actual name of these images (column data).
Wow. That makes my head hurt. I think mySQL is just punishing you for both of those offenses. *hee hee* ;-p But if I were to venture a guess, and RTFM... http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html I'd say it might be related to casting. "If a string function is given a binary string as an argument, the resulting string is also a binary string. A number converted to a string is treated as a binary string. This affects only comparisons." So perhaps in the first case you're dealing with strings, but in the second case you're dealing with numbers? Or possibly you're not escaping your "\" enough? "To search for “\”, specify it as “\\\\”; this is because the backslashes are stripped once by the parser and again when the pattern match is made, leaving a single backslash to be matched against." I don't know, but that should point you in the right direction and perhaps convince you to rename your column and use a more sane data naming convention... good luck! D.Vin http://daevid.com On Tue, 2008-12-09 at 12:42 +1300, SolidEther wrote: > Hi, > > I'm trying to compare strings on a varchar field. > > The code: 'select * from Image where `0020,0032`="-131.178600\ > \107.113725\\200.064000";' returns the correct result set. > > However, the code: 'select * from Image where `0020,0032` LIKE > "%-131.178600\\107.113725\\200.064%";' returns an empty set, and so > does 'select * from Image where `0020,0032` LIKE "-131\.178600\\107\. > 113725\\200\.064000";' > > I can't really figure out why, can anyone explain? > > Thx, > Michael >