I want to join two tables on a char column. The simplest way I use is:
SELECT * FROM a JOIN b ON (a.text = b.text)
This method is quite fast but it the comparison of field is case insensitive. I have tried STRCMP(.., ..) and .. LIKE .. instead .. = .. but both are far to slow. What is the best solution to join two tables on char column with respect to the letter case?
I’ve no possibility to run a benchmark, but have you tried:
EDIT
Just as a sidenote: When using the
BINARYoperator both columnsa.textandb.textmust use the same character set as comparison is done on the byte-level.