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. Syntaxselect strcmp(str1, str2); Parameters:Str1 and str2: two strings to be compared Returns:
Example 1Select strcmp('JAVA', 'java'); Output: Example 2Select strcmp('mysql, 'java'); Output: Example 3Select strcmp('JAVA', 'mysql'); Output:
Next TopicMySQL String
|