Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Removing numbers that has characters in them

Author  Topic 

velvettiger
Posting Yak Master

115 Posts

Posted - 2009-03-12 : 12:16:04
Hi Guys,

So I have a database and I am suppose to exclude all those telephone numbers that have a character in them. E.g a person has a phone number as 12443385678XXX. I want to remove these types of numbers from the final list.

Does anyone have any clues.

Thanks in advance :)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-12 : 12:32:41
SELECT phoneno FROM Table WHERE phoneno NOT LIKE '%[A-Za-z]%'
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-12 : 13:58:13
SELECT phoneno FROM Table WHERE phoneno LIKE '%[^0-9]%'



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -