Archives of the TeradataForum
Message Posted: Wed, 19 Mar 2008 @ 15:48:24 GMT
| Subj: || || Re: Comparing blanks and Nulls |
| From: || || Anomy Anom |
<-- Anonymously Posted: Wed, 19 Mar 2008 09:45 -->
You say "blank (non-null, non-spaces)" but there is no such thing. Teradata trims trailing spaces from VARCHAR fields and pads CHAR fields
with trailing spaces. So there's effectively no difference between an "empty string" and a string containing only spaces.
You can certainly use a CASE statement to "translate" fields WHEN col1='' or CHARACTERS(col1)=0 or CHARACTERS(TRIM(col1))=0 or col1 IS NULL or
whatever makes sense for your application.