我想从my_table中选择类似LIKE’%HEX(9D)’的家庭十六进制格式以9D十六进制结尾的家庭,我将excel文件转换为sqlite数据库,但是我的某些数据以9D结尾结束,我无法正确搜索,请指导我如何删除“家庭”列中的9D十六进制字符?
要在SQLLite中获取HEX(9D),请使用cast(X'9D' as text)。所以要更新使用类似:
cast(X'9D' as text)
UPDATE YOURTABLE SET YOURCOLUMN=REPLACE(YOURCOLUMN,cast(X'9D' as text),'') where YOURCOLUMN like '%'||cast(X'9D' as text)||'%';
UPDATE YOURTABLE SET YOURCOLUMN=REPLACE(YOURCOLUMN,cast(X'9D' as text),'') where YOURCOLUMN like '%'||cast(X'9D' as text)||'%'
要不就
UPDATE YOURTABLE SET YOURCOLUMN=REPLACE(YOURCOLUMN,X'9D','') where YOURCOLUMN like '%'||x'9D'||'%';