sql with substring to a special character with sqlite

前端 未结 2 716
一生所求
一生所求 2021-01-16 18:39

I have values with following format in a table in sqlite:

AAAAAAAAAA#BBBBBBBBBB

AAAA#BBBBBBBBBB

AAAAAAAAAAAAAAAAA#BBBBBBBBBBB

I would lik

2条回答
  •  攒了一身酷
    2021-01-16 19:03

    Please try:

    SUBSTR(col,1,INSTR(col,'#') -1)
    

    Can be found at: http://www.sqlite.org/lang_corefunc.html

提交回复
热议问题