Oracle SQL - Pre-insert SUM -


I need to update records on a table with the following criteria.

The update is a calculation of the number rows, multiplied by a multiplier and then divided by the total amount of calculation. I have managed to get most of these. However, to remain updated about, I need to find a way to get the amount of rows in the calculation from my selection for any rows already explained and decreased.

Is there a way of adding / summarizing the value I used before I query them on a table that have been updated smartly?

The t2.primary_column10 is the moving total that I need to evaluate.

  t2.primary_column1, t2.primary_column2, t2.primary_column3, t2.primary_column4, select case (primary_column6 & gt; variable1) or Primary_column8 = Variable2 the case when t2.primary_column7 & Gt; (Variable1 - yoga (T2kprimary_columnl0) than ()) (Variablel - Yoga (T2kprimary_columnl0) than ()) and t2.primary_column7 end and in the case when t2.primary_column11 & gt; T2.primary_column7 THEN t2.primary_column7 ELSE t2.primary_column11 END END as primary_column5 from (select t3.primary_column1, t3.primary_column2, t3.primary_column3, t3.primary_column4, t3.primary_column11, t3.primary_column7, t3.primary_column9, t3.primary_column6 case when (t3.primary_column6 & gt; variable1) or T3kprimary_column8 = Variable2 case when t3.primary_column7 & LT; (floor (variable1 / (t3.primary_column6) * t3.primary_column11)) then t3.primary_column7 else (Floor1 / (T3.primary_column6) * t3.primary_column11)) Finally case WHEN t3.primary_column11> T3.primary_column7 THEN t3.primary_column7 as primary_column1, primary_column2, primary_column3, primary_column4, as ELSE t3.primary_column11 END END Primary_column7, primary_column11, UPPER (primary_column8) as primary_column8, SUM (primary_col) umn11) over () as well as table_name1 LEFT OUTER to primary_column6 which (primary language preferences, Prathamik_kalin 2, Prathamik_kali 3, Prathamik_sng 4, COUNT (*) Prathamik_ column7, SUM (COUNT (*)) over () AS table_name2 primary primary_column1 Group, primary_column2, primary_column3, primary_column4) using mary_column9 from t5 (primary_column1, primary_column2, primary_column3, primary_column4) Where Primary_column6 = Variable3) T3) T2;  


Comments