Real Test ::
SQL> select * from empgrp;
GID EMP_ID CNT
---------- ---------- ----------
10 1 0
10 2 0
20 1 0
SQL> update empgrp a
2 set cnt = ( select count(cnt) from empgrp b where a.gid = b.gid);
3 rows updated.
SQL> select * from empgrp;
GID EMP_ID CNT
---------- ---------- ----------
10 1 2
10 2 2
20 1 1




Reply With Quote