How to SUM previous sum, e.g N = (N-1) + (N-2) + ... + 1?
This looks like a candidate for window functions.

First calculate the per-id sums, then do a running sum ordered by ID to get the desired final result.

with t_report_code_temp(id, t_code) as
(   
select id, sum(no)
from table_a
group by id 
)
SELECT
  id,
  sum(t_code) OVER (ORDER BY id ASC)
FROM t_report_code_temp;