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, 1369🔥, 0💬
Popular Posts:
Can You Drop an Index Associated with a Unique or Primary Key Constraint in Oracle? You can not dele...
How To Concatenate Two Character Strings Together in SQL Server Transact-SQL? Concatenating two char...
How Run SQL*Plus Commands That Are Stored in a Local File in Oracle? If you have a group of commands...
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
How To Count Rows with the COUNT(*) Function in SQL Server? If you want to count the number of rows,...