Collections:
HEX() - Calculate HEX representation
How to calculate the hexadecimal representation of a given string or integer using the HEX() function?
✍: FYIcenter.com
HEX(in) is a MySQL built-in function that
calculates the hexadecimal representation of a given string or integer.
For example:
SELECT HEX('FYI'), HEX(255);
-- +------------+----------+
-- | HEX('FYI') | HEX(255) |
-- +------------+----------+
-- | 465949 | FF |
-- +------------+----------+
Reference information of the HEX() function:
HEX(in): hex For a string argument, HEX() returns a hexadecimal string representation where each byte of each character in input string is converted to two hexadecimal digits. For a numeric argument, HEX() returns a hexadecimal string representation of the input treated as a longlong (BIGINT) number. This is equivalent to CONV(in, 10, 16) Arguments, return value and availability: in: Required. The input string or integer. hex: Return value. The hexadecimal string representation of the input. Available since MySQL 5.7.
Related MySQL functions:
⇒ INSERT() - Insert and Replace Substring
⇐ FROM_BASE64() - Base64 Decoding
2023-11-13, 2042🔥, 0💬
Popular Posts:
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...
What Is Program Global Area (PGA) in Oracle? A Program Global Area (PGA) is a memory buffer that is ...
What Happens to Your Transactions When ERROR 1205 Occurred in MySQL? If your transaction receives th...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...