Does something like Common Table Expressions exist in PL/SQL?
I recently learned about CTE's in SQL Server and am attempting to use it in PL/SQL. I do not need the recurive benefits of it, however, I would like to use it in lieu of creating 开发者_如何学JAVAa view and to improve query performance. Just looking for some direction on what code may be similar.
In Oracle this is known as subquery factoring, and it works the same as in SQL Server AFAIK:
with cte as (select * from emp)
select * from cte join dept on dept.deptno = cte.deptno;
See SELECT documentation and search for "factoring".
精彩评论