Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么 SQLite hex() 函数为 hex(1) 返回 31。
例如我这样做:
select hex(1) from mytable;
我得到 31 但它不应该返回 1 吗?
谢谢,卡洛斯。
因为 :
hex() 函数将其参数解释为 BLOB 并返回一个字符串,该字符串是该 blob 内容的大写十六进制呈现。
hex() 函数将 BLOB 值转换为十六进制文本表示。参数数据假定为 BLOB。如果它不是一个 BLOB,它将被转换为一个。返回的文本值将包含 BLOB 中每个字节的两个十六进制字符。