Collections:
RIGHT() - Last N Characters
How to return last N characters from a given string using the RIGHT() function?
✍: FYIcenter.com
RIGHT(str, len) is a MySQL built-in function that returns the
last N characters of a giving string. For example:
SELECT RIGHT('dba.FYIcenter.com', 3);
-- +-------------------------------+
-- | RIGHT('dba.FYIcenter.com', 3) |
-- +-------------------------------+
-- | com |
-- +-------------------------------+
Reference information of the RIGHT() function:
RIGHT(str, len): substr Returns the rightmost 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 last len characters. Available since MySQL 4.0.
Related MySQL functions:
⇒ RPAD() - Right-Padding String
⇐ REVERSE() - Reversing String
2023-11-12, 1353🔥, 0💬
Popular Posts:
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time valu...
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...