[ad_1]
With sqlite you’re fairly limited, best I can come up with is something like this:
If ?
is in SOURCE, then take SOURCE from its starting character to where ?
is located. Otherwise, just return SOURCE.
substr(SOURCE, 1, iff(instr(SOURCE, '?') > 0, instr(SOURCE, '?'), NULL))
You might have to replace the second instr(SOURCE, '?')
with instr(SOURCE, '?') - 1
.
[ad_2]