sql - Splitting letters and number in SQLite -
i have 1 column containing letters , numbers (mix/random)
914103b01292ab21hrvh92665
i need split this
914103012922192665 -numbers babhrvh -letters
thanks in advance!
the simplest way in sqlite series of replace functions - so:
select replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(the_string, '0', ''), '1', ''), '2', ''), '3', ''), '4', ''), '5', ''), '6', ''), '7', ''), '8', ''), '9', '') letters_only, ...
- similar series of 26 replace
function calls strip out letters, leaving numbers only.
alternatively, write user-defined function you; non-trivial exercise in sqlite - see this question.
Comments
Post a Comment