C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
MySQL STRCMP() FunctionThe 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
select strcmp(str1, str2); Parameters:
Str1 and str2: two strings to be compared Returns:
Example 1
Select strcmp('JAVA', 'java');
Output:
Example 2
Select strcmp('mysql, 'java');
Output:
Example 3
Select strcmp('JAVA', 'mysql');
Output:
Next TopicMySQL String
|