MS SQL - A way to run a select query with specific requirements?
Posted on 2012-09-04
I have a database with phone numbers like so:
Pretty much, with the dashes.
Now, I have other databases with user information, including phones, but the data isn't in the same format, sometimes its with dashes, sometimes it without. aka 999-999-9999 or 9999999999.
I normally do a
select * into tempTable from personsTable where phone NOT IN (select phone from phoneTable)
to get the phone data. IS there a way to support both dashes and not dashes without me having to make a second db without the dashes and one with?