What is the easiest way to determine the substring index in a varchar column? charindex does not exist in the original version of SQLite3, which is still a bit surprising for me.
In particular, I have a column with values ββlike 010000 , 011000 , 010110 , etc. I want to find the index of the first appearance of 11 . For the examples I gave, I would expect something like NULL (or -1 ), 1 and 3 .
I have a hacked idea that uses length and ltrim , but it seems to me that there is a lot of work for something that I need to do several times.
string substring sqlite3
Benjamin oakes
source share