Archives of the TeradataForum
Message Posted: Thu, 08 Jan 2015 @ 15:40:22 GMT
<-- Anonymously Posted: Thursday, January 08, 2015 10:32 -->
By SQL standards, trailing pad characters don't count - the shorter value is in effect padded to the length of the longer before comparison.
And fixed CHAR always adds padding up to the indicated length when the value is stored.
If you store the data as VARCHAR, you can explicitly require that the lengths match as well as the content:
WHERE (col1 = col2 AND character_length(col1) =character_length(col2))
|Copyright 2016 - All Rights Reserved|
|Last Modified: 24 Jul 2020|