Declaration
STRCMP(expr1,expr2)
Description
If the strings expr1 and expr2 are identical, 0 is returned. If expr1 is a substring of expr2, -1 is returned; if expr2 is a substring of expr1, 1 is returned.
Examples
obclient> SELECT STRCMP('text', 'text2');
+-------------------------+
| STRCMP('text', 'text2') |
+-------------------------+
| -1 |
+-------------------------+
1 row in set
obclient> SELECT STRCMP('text2', 'text');
+-------------------------+
| STRCMP('text2', 'text') |
+-------------------------+
| 1 |
+-------------------------+
1 row in set
obclient> SELECT STRCMP('text', 'text');
+------------------------+
| STRCMP('text', 'text') |
+------------------------+
| 0 |
+------------------------+
1 row in set