I have a string column1. Now, I want to create a second column which counts the number of commas until the first digit appears.
For example, we have [,,4,] then there are 2 commas before the first digit (4) appears. So outcome would be 2. See table below.
Column1 Desired Output Digit
[,,4,] 2 4
[2,,,] 0 2
I am using Redshift SQL.