Collections:
STRCMP() - Comparing Strings
How to compare two strings using the STRCMP() function?
✍: FYIcenter.com
STRCMP(str1, str2) is a MySQL built-in function that
returns -1, 0, or 1 to indicate the sorting order two given strings.
For example:
SELECT STRCMP('String', '$tring');
-- +----------------------------+
-- | STRCMP('String', '$tring') |
-- +----------------------------+
-- | 1 |
-- +----------------------------+
Reference information of the STRCMP() function:
STRCMP(str1, str2): int Returns 0 if the strings are the same, -1 if the first string is smaller than the second according to the sorting order, or 1 if the first is larger than the second. Arguments, return value and availability: str1: Required. The first string to be compared. str2: Required. The second string to be compared. int: Return value. -1, 0, or 1 indicating the sorting order. Available since MySQL 4.0.
⇒ SUBSTR() - Synonym for SUBSTRING()
⇐ SPACE() - Repeating Space Character
2023-11-13, 1664🔥, 0💬
Popular Posts:
How to obtain the number of rows found by the last SELECT statement using the FOUND_ROWS() function?...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to...