Q:

Oracle: Calculate percentage and update the table

My table looks like the following
id | SomeValue | count | percentage
1  | plum      | 9     |
2  | apple     | 2     |
3  | banana    | 10    |
4  | orange    | 8     |

I only want to consider rows with id >=2. The percentage for apple should be 2/(2+10+8)=0.1
The same method applies to all rows. 
I can get the total with 
select sum(count) from table1 where id>=2

to update percentage, I currently have
update table1 
set percentage=count/(select sum(count) 
                      from table1 
                      where id>=2) 
where id>=2

This works for my purpose, but I think it recalculates the sum for each row (correct me if I'm wrong), and it's not very efficient. Please help me make this as efficient as possible. I have to update up to a million records. Thank you.

A:

In oracle It does not recalculates 
Here is an example:
create table t1 (
  col1 number
  );

INSERT INTO t1
SELECT
  null col1
FROM  dual
CONNECT BY level <= 50;

CREATE table t2 as select * from t1;

UPDATE T1
SET COL1 = dbms_random.value(0, 1000); 

UPDATE t2
SET  col1 = (select dbms_random.value(0, 1000) from dual);

Where 
SELECT * from T1;  --Gives random output

SELECT * from T2;  --Only randomize first time.

Check DbFiddle Link

