• update t set Allocation = 1

    from transactiontable t

    inner join (

       select Accnt_code from transactiontable

       from transactiontable

       group by Accnt_code

       having sum(Other_amt) = 0

    ) a on t.Accnt_code = a.Acctn_code

    where Allocation is null or Allocation <> 1