Good day!
There is a need to break the line into components, namely how to pull out the phone number following the comma ('8555555555, 8999999999, 9166666666, etc.')
How to do it?
There can be one or fifteen phones, and you need to pull out all the phone numbers from the maximum possible after the comma))
My life:
SELECT '8555555555, 8999999999, 9166666666' as [All NUM] ,SUBSTRING('8555555555, 8999999999, 9166666666', 1, charindex(',', '8555555555, 8999999999, 9166666666')-1) as [First NUM] ,SUBSTRING('8555555555, 8999999999, 9166666666', charindex(',', '8555555555, 8999999999, 9166666666')+1, LEN('8555555555, 8999999999, 9166666666') - charindex(',', '8555555555, 8999999999, 9166666666')) as [All after first NUM] ,right('8555555555, 8999999999, 9166666666',charindex(',', SUBSTRING('8555555555, 8999999999, 9166666666', charindex(',', '8555555555, 8999999999, 9166666666')+1, LEN('8555555555, 8999999999, 9166666666') - charindex(',', '8555555555, 8999999999, 9166666666')))-2) as [Last NUM]