Target row updated by MUltiple source rows error

Database

Target row updated by MUltiple source rows error

Hi,

could you please help on this.

i am trying to update the table am getting the Target row updated by MUltiple source rows error.

both tables having same structure ,update statement like below.

update table a

set a.clo1=b.col1,

a.col2=b.col2,

..

..

..

where

a.primary index=b.primary index.

how can i find the duplicate rows?

2 REPLIES
Teradata Employee

Re: Target row updated by MUltiple source rows error

You can find the duplicates by:

SELECT <primary index column(s)>, count(*) FROM <Table Name> GROUP BY <primary index column(s)> HAVING COUNT(*) > 1

Re: Target row updated by MUltiple source rows error

Hi,

could you pls help how to find DUPS below statements.

Here we are updating same table....soure and target tables are same ..

could you pls suggest how can we find Dups...

Update table1

(select*

from table 2

where coditions

(select * from Table 3

where conditions))   S1

sett1. enddt=S1.enddt

where s1.column=t1.coloumn

...

..

....

;