Archives of the TeradataForum
Message Posted: Fri, 04 Aug 2006 @ 22:26:28 GMT
Subj: | | Re: Missbehaving char/varchar data in teradata sql assistent |
|
From: | | Victor Sokovin |
| It's always a question for me too, why it's the case even with VARCHAR. I know what happens with CHAR(N), fine. | |
CHAR(N) are tricky but they have one advantage: fixed length.
In the example above you compare strings of different length. The literal on the right hand side is of length 6. The value in the VARCHAR
column has the length of 3. 3<6. Teradata rule (as stated in, for example, Functions and Operators SQL Ref):
"Comparison of Character Strings of Unequal Length
If character strings of unequal length are being compared, the shorter of the two is padded on the right with pad characters before
the comparison occurs."
The example seems to comply with this rule.
Victor
|