I have a large table with a column containing phone numbers that are formatted inconsistently. i.e 01234567890 or possibly 01234 567 890.
I'm looking for a select statement that will return the record as long as the user search contains the numbers in the correct order regardless of spacing of the record in the database.
So if the user search using 0123456789 it would return the record containing 01234 567 890 or vice versa.
Currently using like but not working as I'd like. Any ideas?
SELECT *
FROM contacts
WHERE telephone LIKE '%01234567890%