首页 > 解决方案 > How to specify a hex character as part of a string in sqlite?

问题描述

Is there a way to specify a hex character in sqlite that is part of a string?

I have a string of the form: 'abc' 0xf1 'def' (the character 0xf1 is the 4th character of the string)

how do I create string so I can do the following query:

select * from table where attribute = 'abc' 0xf1 'def'

thank you in advance for any help.

标签: sqlsqlite

解决方案


From https://sqlite.org/lang_expr.html#literal_values_constants_

BLOB literals are string literals containing hexadecimal data and preceded by a single "x" or "X" character. Example: X'53514C697465'

In your case: x'F1'


推荐阅读