Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 17 Jun 2004 @ 11:44:48 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023