May 2005
Intermediate to advanced
352 pages
14h 39m
English
STRCMP( )
STRCMP(string,string)
This function compares two strings to determine whether the first string is before or after the second string in ASCII sequence. If the first string precedes the second, -1 is returned. If it follows the second, 1 is returned. If they are equal, 0 is returned. This function is often used for alphanumeric comparisons, but is case-sensitive.
SELECT STRCMP('test','text')
AS Comparison;
+------------+
| Comparison |
+------------+
| -1 |
+------------+Read now
Unlock full access