This MariaDB tutorial explains how to use the MariaDB STRCMP function with syntax and examples.
The MariaDB STRCMP function tests whether two strings are the same using the current character set.
The syntax for the STRCMP function in MariaDB is:
STRCMP( string1, string2 )
The two strings to be compared to each other.
The STRCMP function can be used in the following versions of MariaDB:
Let's look at some MariaDB STRCMP function examples and explore how to use the STRCMP function in MariaDB.
For example:
SELECT STRCMP('AODBA.com', 'AODBA.com');
Output: 0
SELECT STRCMP('data.com', 'AODBA.com');
Output: -1
SELECT STRCMP('AODBA.com', 'data.com');
Output: 1