STRCMP
STRCMP is a SQL function used to compare two strings. It returns 0 if both strings are the same, -1 if the first string is smaller than the second, and 1 if the first string is greater than the second. The comparison is based on the ASCII value of characters.
Example
Output
Explanation
In this example, the STRCMP() function compares two strings “Hello” and “World”. The result is -1 because “Hello” is less than “World” based on the ASCII value.