9D (Hex) character remove in sqlite

前端 未结 1 1096
北恋
北恋 2021-01-07 02:48

i want select family from my_table where family LIKE \'%HEX(9D)\' family hex format ended with 9D hex i convert excel file in to sqlite database but some of my data add 9D i

1条回答
  •  广开言路
    2021-01-07 03:37

    To get HEX(9D) in SQLLite use cast(X'9D' as text). So to update use something like:

    UPDATE YOURTABLE SET YOURCOLUMN=REPLACE(YOURCOLUMN,cast(X'9D' as text),'') where YOURCOLUMN like '%'||cast(X'9D' as text)||'%';

    or just

    UPDATE YOURTABLE SET YOURCOLUMN=REPLACE(YOURCOLUMN,X'9D','') where YOURCOLUMN like '%'||x'9D'||'%';
    

    0 讨论(0)
提交回复
热议问题