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, 1487🔥, 0💬
Popular Posts:
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
How To Query Tables and Loop through the Returning Rows in MySQL? The best way to query tables and l...
How To Convert Characters to Numbers in Oracle? You can convert characters to numbers by using the T...
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Ex...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...