Update with group by in subquery
create table a1 (id varchar2(20), sal number(3));
insert into a1('a',1);
insert into a1('b',2);
insert into a1('c',3);
create table a2 (id varchar2(20), sal number(3));
insert into a2('a',1);
insert into a2('a',5);
insert into a2('b',8);
Now we've to update a1.sal with sum(b1.sal) like
update a1 set sel=select sal from(
select id,sum(sal)sal from a2 group by id) b
where a1.id=b.id;
how can we do that...?