Archives of the TeradataForum
Message Posted: Fri, 04 Apr 2008 @ 10:47:08 GMT
Subj: | | Re: Duplicate Row Error during an Update |
|
From: | | Gaitonde, Amol A |
You are trying to update one row with 2 values( May be different or same). the query is logically incorrect.
Example
TABLE EMP
NAME TASK_SCORE YEAR
Jon 1.105 2000
Peter 1.107 2000
Jon 1.105 2001
Peter 1.103 2001
TABLE EMP
NAME SALARY
Jon 100000
Peter 100000
If you write a query like below you might get a duplicate row error
Update B
Set salary = slary* Tas_Scoe
Where a.name = B.name
Because I have missed putting filter on year and the salary field is getting updated with two values
|