STRCMP
Declaration
STRCMP(expr1,expr2)
Description
Returns 0 if the strings expr1 and expr2 are the same. Returns -1 if expr1 is a substring of expr2. Returns 1 if expr2 is a substring of expr1.
Example
SELECT STRCMP('text', 'text2');
+-------------------------+
| STRCMP('text', 'text2') |
+-------------------------+
| -1 |
+-------------------------+
1 row in set (0.001 sec)
SELECT STRCMP('text2', 'text');
+-------------------------+
| STRCMP('text2', 'text') |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.000 sec)
SELECT STRCMP('text', 'text');
+------------------------+
| STRCMP('text', 'text') |
+------------------------+
| 0 |
+------------------------+
1 row in set (0.000 sec)