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, 1199🔥, 0💬
Popular Posts:
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...
What are binary literals supported in SQL Server Transact-SQL? Binary literals in Transact-SQL are s...
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...