The STRCMP function is used to check the equality of two strings in MySQL.
syntax :
STRCMP(str1,str2)
here str1 and str2 is string
what is the return of the STRCMP based on the given string ?
if str1 and str2 are the same or equal(case insensitive check), it will return 0
if str1 is greater than str2, it will return 1
if str1 is small than str2, it will return 1
examples
select STRCMP("arrayoverflow","arrayoverflow")
// return is 0
select STRCMP("arrayoverflow","Arrayoverflow")
// return is 0
select STRCMP("arrayoverflow.com","arrayoverflow")
// return is 1
select STRCMP("arrayoverflow.com","arrayoverflow.com")
// return is -1
select STRCMP("arrayoverflow","Arrayoverflow")
// return is 0
13
select
STRCMP("a","z")
// return is 1