I have values in my column as below. Can anyone help me with how to replace any numeric data present in a column or string to blank using SQL Server query?
Below is the column data. How do I replace the numbers to blank and display only underscores.
Advertisement
Answer
You could approach this by counting the number of underscores, and then generating a string containing this number of underscores:
SELECT Column1, REPLICATE('_', LEN(Column1) - LEN(REPLACE(Column1, '_', ''))) FROM yourTable;