Tuesday, February 13, 2007

[sql] Find all numerics out of varchar column

I have a varchar column that contain a mix of alpha and numeric values. I need to find all rows where the column contain only numeric characters.

Solution (either one works):
select * from myTable where myCol not like '%[a-z]%';
select * from myTable where isnumeric(myCol)=1;


No comments:

Post a Comment