HEX(N_or_S)
If N_or_S
is a number, returns a string representation of the hexadecimal value of N
, where N
is a longlong
(BIGINT
) number. This is equivalent to CONV(N,10,16)
.
If N_or_S
is a string, returns a hexadecimal string representation of N_or_S
where each byte of each character in N_or_S
is converted to two hexadecimal digits. If N_or_S
is NULL, returns NULL. The inverse of this operation is performed by the UNHEX() function.
SELECT HEX(255); +----------+ | HEX(255) | +----------+ | FF | +----------+ SELECT 0x4D617269614442; +------------------+ | 0x4D617269614442 | +------------------+ | MariaDB | +------------------+ SELECT HEX('MariaDB'); +----------------+ | HEX('MariaDB') | +----------------+ | 4D617269614442 | +----------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/hex/