Reputation: 309
I have a column in SQLite which contains strings such as:
equal_to#1 capable#4 adequate_to#1
I would like to get the following results:
equal_to, capable, adequate_to
I'm trying to get it working with replace but with no luck, perhaps someone might help me with some regex?
Upvotes: 0
Views: 322
Reputation: 1232
Use substr and instr
select substr("equal_to#1", 0, instr("equal_to#1", '#'))
output:
equal_to
Upvotes: 2