Archives of the TeradataForum
Message Posted: Wed, 19 Mar 2008 @ 20:22:33 GMT
Subj: | | Re: Comparing blanks and Nulls |
|
From: | | Michael Larkins |
Sounds like you have some pretty inconsistent source data that might better be scrubbed before you load it into a production table.
Additionally, you have not specifically told us, but to have a zero length I am assuming that the string must be varchar. Also as pointed out
previously, a zero length character string is not the same as a NULL. So have you considered:
,case when char(blank_column) = 0 then '*' else blank_column) end
.
.
.
MINUS ALL
,coalesce(nullable_column,'*')
.
.
.
If need be, you can also check for the NULL in the same case statement. If you have similiar inconsistencies in the second table you can
impliment the coalesce using a case and compare for multiple values there as well.
Hope this helps,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
|