My answer was going to be very similar to the one by Andy Korneyev, but I'm going to add some extra details.
WHY A COLUMN WITH NORMALIZED PHONE NUMBERS?
If you have a lot of rows in your table, it's advisable to have a column with a normalized format, so that, when your user wants to look for a phone number, the application normalizes it and looks for it.
If you use any of the solution to query by normalizing the user entry as well as the value in the table column your server has to do extra work, and there is not a chance to use indexes.
So, the best solution by far is having that normalized column.
This column can be created directly from the application, or apply triggers to the original table to create the normalized column (I personally wouldn't use triggers).
WHAT TO DO ABOUT PREFIXES TO KEEP USING THE INDEX?
And finally, there is a typical case when looking for phone numbers: sometimes people include the prefix, sometimes not. So you would have to look with a predicate like this WHERE T.PhoneNumber LIKE '%5551234'
. If you do so, you wouldn't get any benefit if your phone number column is indexed.
To solve this typical problem the number is stored normalized and reversed, i.e. the previous sample would be stored like this: '4321555', or '4312555070', for example, if there was a prefix.
Normalization apart (i.e. remotion of non digits), when your user looks for '5551234' or even for '0705551234', the application can reverse it, and use a predicate like this:
WHERE T.PhoneNumber LIKE '4321555%' OR '4321555' LIKE T.PhoneNumber+'%'
The first part covers the case when the number in the DB has prefix, and the user doesn't specify it. (i.e. the stored phone numer is 4321555070
)
The second part covers the opposite case. You'll see it more clearly with this sample (when the stored phone number is 4321555
):
WHERE T.PhoneNumber LIKE '4321555070%' OR '4321555070' LIKE T.PhoneNumber+'%'
Thats' why, in many CRMs you'll find a "ReversedPhoneNumber" field.
By the way, when you reverse the number, if there is an index available, it will be used, speeding up the search.