Description\n-----------\n\nHexadecimal literals can be written using any of the following syntaxes:\n\n x'value'\n X'value' (SQL standard)\n* 0xvalue (ODBC)\n\nvalue is a sequence of hexadecimal digits (from 0 to 9 and from A to F). The case of the digits does not matter. With the first two syntaxes, value must consist of an even number of digits. With the last syntax, digits can be even, and they are treated as if they had an extra 0 at the beginning.\n\nNormally, hexadecimal literals are interpreted as binary string, where each pair of digits represents a character. When used in a numeric context, they are interpreted as integers. (See the example below). In no case can a hexadecimal literal be a decimal number.\n\nThe first two syntaxes; X'_value_' and x'_value_, follow the SQL standard, and behave as a string in all contexts in MariaDB. The latter syntax, 0x_value_, is a MySQL/MariaDB extension for hex hybrids and behaves as a string or as a number depending on context. MySQL treats all syntaxes the same, so there may be different results in MariaDB and MySQL (see below).\n\nExamples\n--------\n\nSELECT x'61', X'61', 0x61;\n+-------+-------+------+\n| x'61' | X'61' | 0x61 |\n+-------+-------+------+\n| a     | a     | a    |\n+-------+-------+------+\n\nURL: https://mariadb.com/docs/server/reference/sql-structure/sql-language-structure/hexadecimal-literals