Archives of the TeradataForum
Message Posted: Wed, 19 Mar 2008 @ 23:13:24 GMT
Subj: | | Re: Comparing blanks and Nulls |
|
From: | | ulrich arndt |
Hi anomy,
would
select case when a is null then '' -- NULL to empty sting
when trim(both from a) = ''
then '' -- blank(s) to empty string
else a end
from a
minus
select case when a is null then ''
when trim(both from a) = ''
then ''
else a end
from b
do the trick?
In case empty string should be handeld different from blank then
case when a is null then ' ' -- Null to one blank
when trim(both from a) = '' and characters(a) >= 1
then ' '
else a end
Ulrich
|