|
|
Archives of the TeradataForum
Message Posted: Wed, 02 Jul 2003 @ 21:18:02 GMT
Subj: | | Re: Selecting the min. non-null date |
|
From: | | Burton, Bruce |
here is the code I'm trying to get to work...
this code does not seem to work on a join condition. are there rules for spanning columns with a "min" function and/or issues with using
the "min" in a join condition? I'm basically trying to compare a "min" series of dates from one table to a "max" series of dates on another
table.
sel *
from
table1 t1
left join
table2 t2
on t1.column1=t2.column1
and min(t1.date1,t1.date2,t1.date2,t1.date4)-
max(t2.date1,t2.date2,t2.date3,t2.date4)<=365
Any help is appreciated.
Thanks,
Bruce
| |