My current MSSQL table has a "phone" column which is a varchar. Unfortunately, the phone numbers that are already in the database are not in standard format. For example, 888-888-8888 OR 888/888/8888 OR (888)8888888 OR 8888888888.
I want to get all the rows that are equivalent to 88888888, i.e it should match with 888-888-8888, (888)888888 etc.
I have tried using REPLACE() but there are certain rows where entries have other alphabetic characters like "e", "ex", "ext", etc. So I would like to replace all non-numeric characters.
What would be the best way to get the "matching" rows using MSSQL query?