Introduction to the use of with in oracle subquery; Introduction to oracle
Recently I have studied oracle and want to improve the efficiency and ease of reading of statements I have written. Today's note is about subquery factors.
Factor-based query may not necessarily improve efficiency, but it will certainly improve the readability of the program.
-- With statement with sales_c (select sales, e_NO, e_name from emplyee) select * from sales_c; -- the query result is (select sales, e_NO, e_name from emplyee) the content in this word table -- with a declaration can be used at will in the following example to improve code readability-for example, with sales_c (select sales, e_NO, e_name from emplyee ), name_c (select sales, e_name from sales_c) select * from sales_c, name_c; -- Reading is really convenient
Principle: oracle uses the query_name of with query_name as a temporary table or view to harden the query efficiency.