102
MySQL STRCMP() Function
The strcmp() is a String function of MySQL. This function compares the given two strings. This function returns 0 if both the strings are same, -1 if the first string is smaller than second else it returns 1.
Syntax
Parameters:
Str1 and str2: two strings to be compared
Returns:
- If both the strings are same, this function will return 0.
- If str1 is smaller than str2, this function will return -1.
- If str1 is larger than str2, this function will return 1.
Example 1
Output:
Example 2
Output:
Example 3
Output:
Next TopicMySQL String