How to Have Function Definition and Subquery in With Clause of Oracle Select Statement?
17:44 07 Aug 2018

I know the right syntax for having a function definition in the WITH clause. I know the right syntax for having a subquery in the WITH clause. But I have been unable to find an example of having a subquery and a function definition in the WITH clause of a SELECT statement.

If I have:

with totals as ( select colum_name from some_table )
select sum(column_name) from totals;

How do I add a function definition in the WITH clause?

oracle-database oracle12c