STRCMP(expr1,expr2) : STRCMP : String Functions MySQL TUTORIALS


MySQL TUTORIALS » String Functions » STRCMP »

 

STRCMP(expr1,expr2)


STRCMP() returns 0 if the strings are the same.

STRCMP() returns -1 if the first argument is smaller than the second according to the current sort order.

STRCMP() returns 1 otherwise.

mysql> SELECT STRCMP('text', 'text2');
+-------------------------+
| STRCMP('text', 'text2') |
+-------------------------+
|                      -|
+-------------------------+
row in set (0.00 sec)

mysql> SELECT STRCMP('text2', 'text');
+-------------------------+
| STRCMP('text2', 'text') |
+-------------------------+
|                       |
+-------------------------+
row in set (0.00 sec)

mysql> SELECT STRCMP('text', 'text');
+------------------------+
| STRCMP('text', 'text') |
+------------------------+
|                      |
+------------------------+
row in set (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo String Functions
» STRCMP