This one works perfectly

INSERT INTO table2(ANSWER)

SELECT P1 + (P2-P1)*(SRL-R1)/decode(r2,r1,null,R2-R1)

FROM table1

WHERE condition;

INSERT INTO table2(ANSWER)

SELECT P1 + (P2-P1)*(SRL-R1)/decode(r2

FROM table1

WHERE condition;