| Archives of the TeradataForumMessage Posted: Wed, 29 Mar 2006 @ 14:55:19 GMT
 
 
  
| Subj: |  | Re: Cast Operator |  |  |  | From: |  | Dieter Noeth |  
 Sidharth Kunnath wrote: |  | Why do these two queries yield different o/ps |  | 
 
 
 The maximum number of digits for an integer is 10 plus leading sign -> 11 chars. 
 |  | select employee_number (char(10)) from employee; |  | 
 
 
 This is an ANSI style CAST, it's left aligned with trailing blanks. 
 |  | select cast(employee_number as char(10)) from employee; |  | 
 
 
 This is a Teradata style CAST, it's right aligned with leading blanks. Be aware of automatic typecasts, which are always Teradata style: 
     select 1 || 1, position(1 in 1234567), position(2 in 123456789);
 Dieter 
 
 |