I have a string of the form '_10_245_' of varchar type to represent a list of integers.
Is there a way to extract the numbers out of that string?
examples of the string:
'_34_'
'_123_78_'
'_34_155_134_'
I manged to convert the string into the form of '34 155 134' using replace , ltrim and rtrim...but what should I do next?How can I split that string? As soon as I do that, I will convert each substring into int using the cast function.
Also note that the string it's not always the same; there's a column in a table containing those strings as its values.
Each of those numbers is a code and exists in another table A in an int column. Table A also provides each code's description in a varchar column.
I want to match each number in my string to its description in table A.