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, 216🔥, 0💬
Popular Posts:
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINU...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...