Update with sum

Hello

I have table1 and table2
Table1: (id, col1, col2)
Table2: (id, col1)

The table 2 is the detail of table1

Table1:

1,A, 100
2, B, 300

Table2:

1, 40
1,60
2,100
2,200

i want to update table1 with data of table2:

i do this

update table1 set table1.col2 = sum(table2.col1)
from table2
where table1.id = table2.id

The message manque agregate

If i add this

group by table2.id

i have a syntax error

:with cteCrossant
as
(
selecr sum(col1) merci, id
from table2
group by id)
update tgt
set tgt.col2 = arc.merci
from table2 tgt
join cteXrossant src on tgt.id =src.id