STRCMP(expr1,expr2) STRCMP() returns 0 if the strings are the same, -1 if the first argument is smaller than the second according to the current sort order, and 1 otherwise. mysql> SELECT STRCMP('text', 'text2'); -> -1 mysql> SELECT STRCMP('text2', 'text'); -> 1 mysql> SELECT STRCMP('text', 'text'); -> 0 STRCMP() uses the current character set when performing comparisons. This makes the default comparison behavior case insensitive unless one or both of the operands are binary strings.
SELECT UPPER('VASYA') = UPPER('vasya'); Вернет 1. Хотя по идее MySQL сравнивает их и так без учета регистра. SELECT 'VASYA' = 'vasya'; Вернет 1.