STRCMP
Compare two strings. This function returns 0 if strings are equal, -1 if the first is smaller, and 1 if the first is larger.
Syntax
STRCMP(expr1,expr2)Description
Examples
SELECT STRCMP('text', 'text2');
+-------------------------+
| STRCMP('text', 'text2') |
+-------------------------+
| -1 |
+-------------------------+
SELECT STRCMP('text2', 'text');
+-------------------------+
| STRCMP('text2', 'text') |
+-------------------------+
| 1 |
+-------------------------+
SELECT STRCMP('text', 'text');
+------------------------+
| STRCMP('text', 'text') |
+------------------------+
| 0 |
+------------------------+Last updated
Was this helpful?

