Update duplicating rows. ERROR 7547 Target row updated by multiple rows

Teradata Debugger
Fan

Update duplicating rows. ERROR 7547 Target row updated by multiple rows

Hi all

 

I need some help. I have been trying to update a table for some time now but the update is not working it just duplicating rows in my where statement.

 

update  finance.revenue_classification  from
(
    SELECT DISTINCT

       Subs_Id,
        mth,
        Scndy_Offg,
        Bundle,
        Allocated
     FROM FINANCE.Bundle_Alloc
     WHERE mth = 201704

)    T

set
Scndy_Offg = T.Scndy_Offg,
Bundle_count = T.Bundle,
Allocated = T.Allocated
where  FINANCE.revenue_classification.Subs_Id = T.Subs_Id
and FINANCE.revenue_classification.mth = T.mth;

 

Thanks in advance

2 REPLIES
Teradata Employee

Re: Update duplicating rows. ERROR 7547 Target row updated by multiple rows

Not sure what the intent is, but maybe it would help you to look at the cases where there are multiples, e.g.

 

    SELECT

       Subs_Id,
        mth,

        COUNT(*)
     FROM FINANCE.Bundle_Alloc
     WHERE mth = 201704

GROUP BY 1, 2

HAVING COUNT(*) > 1

 

Fan

Re: Update duplicating rows. ERROR 7547 Target row updated by multiple rows

Thanks for the reply Fred.The table i am trying to update already has information from previous months eg mth 201703 and so forth and aslo has a row for 201704 with information missing hence the update. will try your solution thanks again