↧
Answer by Lukasz Szozda for Nested cos() calculation in Oracle 10
Using WITH FUNCTION(Oracle 12c):WITH FUNCTION coscos(n INT) RETURN NUMBER ISBEGIN IF n > 1 THEN RETURN cos(coscos(n-1)); ELSE RETURN cos(0); END IF;END;SELECT n, coscos(n)FROM t;db<>fiddle...
View ArticleAnswer by Jon Heller for Nested cos() calculation in Oracle 10
The MODEL clause can solve this:Test data:create table test1(n number unique);insert into test1 select * from table(sys.odcinumberlist(1,2,5,10));commit;Query:--The last row for each N has the final...
View ArticleNested cos() calculation in Oracle 10
I have table with some positive integer numbers n----12510For each row of this table I want values cos(cos(...cos(0)..)) (cos is applied n times) to be calculated by means of SQL statement (PL/SQL...
View Article