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, 1097🔥, 0💬
Popular Posts:
Where to find MySQL database server tutorials? Here is a collection of tutorials, tips and FAQs for ...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
How Fixed Length Strings Are Truncated and Padded in SQL Server Transact-SQL? When the length of the...
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...