All columns in the all_chainstable that can contain a hexadecimal string are stored in byte code. For example 👇

These fields include:
block_hashblock_parent_hashtx_hashtx_sendertx_recipientlog_emittertopic0 - topic3data0 - data3data_restThere are two places in a query where these fields might need to be transformed from byte code into their hexadecimal representation (e.g 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2):
SELECT hex(log_emitter) turns byte code (4�f�P��Fq) into it's hexadecimal form ('0xC02aaA39b2..')WHERE log_emitter = unhex('0xC02aaA39b2..') turns hexadecimal format ('0xC02aaA39b2..') into byte code (4�f�P��Fq)As you can see, hex() is used in the SELECT statement and unhex() in the WHERE statement.
SELECT hex(tx_hash), tx_hash
FROM blockchains.all_chains
LIMIT 10
-- Run to see the effects of hex()
SELECT *
FROM blockchains.all_chains
WHERE tx_hash = unhex('ffffffbf8bcb4d1d30609a2fbc044e9e0f7101d06f332a73c88a7dff383cfa13')
-- Run to see the effects of unhex()