Archives of the TeradataForum
Message Posted: Wed, 08 Nov 2006 @ 14:11:56 GMT
Subj: | | Re: Need help with error code 3706 |
|
From: | | Michael Larkins |
Isn't the following going to set all rows to the same minimum?
> UPDATE lp_test_table from
> (SELECT min(lp2.OB_TMSTMP)
> FROM lp2.lp_test_table lp2, lp_test_table lp1
> WHERE lp2.lead_num = lp1.lead_num
> AND lp2.OB_TMSTMP > lp1.OB_TMSTMP) mytbl(col1)
> SET NEXT_OB_TMSTMP = mytbl.col1;
I think it needs a WHERE clause for the update to match on lead_num before it will work to get the correct MIN value.
Regards,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
|