Mariadb Strcmp Function
MariaDB: STRCMP Function
This MariaDB tutorial explains how to use the MariaDB STRCMP function with syntax and examples.
Description
The MariaDB STRCMP function tests whether two strings are the same using the current character set.
Syntax
The syntax for the STRCMP function in MariaDB is:
Parameters or Arguments
- string1 and string2
The two strings to be compared to each other.
Note
- If string1 and string2 are the same, the STRCMP function will return 0.
- If string1 is smaller than string2, the STRCMP function will return -1.
- If string1 is larger than string2, the STRCMP function will return 1.
Applies To
The STRCMP function can be used in the following versions of MariaDB:
Example
Let's look at some MariaDB STRCMP function examples and explore how to use the STRCMP function in MariaDB.
For example: