Archives of the TeradataForum
Message Posted: Tue, 07 Nov 2006 @ 22:06:15 GMT
Subj: | | Re: Need help with error code 3706 |
|
From: | | Michael Larkins |
Randall:
You can't use a subquery in a SET. You might try the following:
> UPDATE lp_test_table lp1
> SET NEXT_OB_TMSTMP = ob_tmstmp
> WHERE ob_tmstmp = (SELECT min(OB_TMSTMP) FROM lp_test_table lp2
> WHERE lp2.lead_num = lp1.lead_num
> AND lp2.OB_TMSTMP > lp1.OB_TMSTMP);
My only concern about your code would then be whether or not you have an ob_tmstmp greater than the current one.
Regards,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
|