I have to select only values that are numeric and length 7 from a table. Such as 1234567, 9092333 etc.. Values such as a190802, aaaaaaa, 10/2233 etc should not be selected. Any help? Thanks
Select * From MyTable
Where LENGTH(Ncol) = 5
And TRANSLATE(Ncol,'~0123456789','~') Is NULL;
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.