Archives of the TeradataForum
Message Posted: Thu, 17 Jun 2004 @ 11:44:48 GMT
Subj: | | Re: How to identify numerics in alphanumerics ? |
|
From: | | Victor Sokovin |
| If you already know the data contains only numbers and letters, then the following will select all rows with pure numeric values: | |
| sel col1 where upper(col1) (cs) = lower(col1); | |
| This works by converting the alpha characters to uppercase (left side) and lowercase (right side) and then doing a casespecific comparison.
If the two sides are not equal (for a particular row), then you know column1 does not contain pure numerics (e.g. digits 0 through 9). | |
I'm pretty sure this works for the English characters but there are exceptions in other languages. For example, consider the German '�'
character. I don't know whether it will survive the posting process. If it does not, it is the one you see in the word "stra�e" (it might be the
old spelling of this word, though). This character will appear in the result set of the above query together with the numeric values.
I did not take a look at other languages from this point of view but I would not be surprised if one can find more of such characters.
The alternative might be to use
select col
from table
where col <'a'
or something along these lines.
Regards,
Victor
|