Archives of the TeradataForum
Message Posted: Mon, 12 May 2008 @ 20:12:21 GMT
| Subj: || || Re: View with Default and Null values |
| From: || || Victor Sokovin |
| ||My problem is why the last SQL does not return any rows. My hypothesis is that since the view has a default defined, it assumes this field
will have default value for all rows in the join, even though this is a left join and NOT ALL rows may have a match. Regardless, I think this is
not ideal. Can the members confirm if this is not an acceptable behavior or a bug? Any workarounds (short of not using defaults in the
I don't see any problem with the results. As defined, the view does not have any NULLs in Column2. Constant string 'Default' is the value of
the column so the WHERE clause ( where TB2.Column2 is NULL ) eliminates all rows (Column2 does not participate in the JOIN condition). I am not
sure what you are trying to achieve. Perhaps you intend to use the LEFT JOIN on *both* columns? This should give you more possibilities.
Otherwise, try to give more details and somebody may come up with more suggestions.