Collections:
LEFT() - First N Characters
How to return first N characters from a given string using the LEFT() function?
✍: FYIcenter.com
LEFT(str, len) is a MySQL built-in function that returns the
first N characters of a giving string. For example:
SELECT LEFT('dba.FYIcenter.com', 3);
-- +------------------------------+
-- | LEFT('dba.FYIcenter.com', 3) |
-- +------------------------------+
-- | dba |
-- +------------------------------+
Reference information of the LEFT() function:
LEFT(str, len): substr Returns the leftmost len characters from the string str, or NULL if any argument is NULL. Arguments, return value and availability: str: Required. The given string to be extracted from. len: Required. The number of characters of the substring. substr: Return value. The substring of first len characters. Available since MySQL 4.0.
Related MySQL functions:
⇒ LENGTH() - Number of Bytes in String
⇐ LCASE() - Synonym for LOWER()
2023-11-12, 1547🔥, 0💬
Popular Posts:
How to format a number of bytes in a human-readable unit using the FORMAT_BYTES() function? FORMAT_B...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
How to detect the collation coercibility associated to a given character string using the COERCIBILI...
What Is Transport Network Substrate (TNS) in Oracle? TNS, Transport Network Substrate, is a foundati...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...