sql with substring to a special character with sqlite

前端 未结 2 732
一生所求
一生所求 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 18:51

    Never used sqlite but something along the lines of substr(yourfieldname, 1, instr(yourfieldname, '#') -1) should do it.

提交回复
热议问题