Introduction to the use of with in oracle subquery; Introduction to oracle

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.