Collections:
CHAR() - Building String from Byte Values
How to build a string from byte values using the CHAR() function?
✍: FYIcenter.com
CHAR(N, ... USING charset_name) is a MySQL built-in function that
builds a string from multiple integers interpreted as ASCII byte values.
For example:
SELECT CHAR(70, 89, 73), ASCII('F'), ASCII('Y'), ASCII('I');
-- +------------------+------------+------------+------------+
-- | CHAR(70, 89, 73) | ASCII('F') | ASCII('Y') | ASCII('I') |
-- +------------------+------------+------------+------------+
-- | FYI | 70 | 89 | 73 |
-- +------------------+------------+------------+------------+
Reference information of the CHAR() function:
CHAR(N, ... USING charset_name): str Interprets each argument N as an integer and returns a string consisting of the characters given by the code values of those integers. NULL values are skipped. CHAR() arguments larger than 255 are converted into multiple result bytes. For example, CHAR(256) is equivalent to CHAR(1,0), and CHAR(256*256) is equivalent to CHAR(1,0,0). Arguments, return value and availability: N, ...: One or more integers to be interpreted. USING charset_name: Optional. Default is USING ascii. str: Return value. The string created from given byte values. Available since MySQL 4.0.
Related MySQL functions:
⇒ CHAR_LENGTH() - Number of Characters
⇐ BIT_LENGTH() - Number of Bits in String
2023-11-13, 1312🔥, 0💬
Popular Posts:
How To Provide Default Values to Function Parameters in SQL Server Transact-SQL? If you add a parame...
What Is a Parameter File in Oracle? A parameter file is a file that contains a list of initializatio...
Can You Drop an Index Associated with a Unique or Primary Key Constraint in Oracle? You can not dele...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...