Oracle SQL advanced programming learning notes (I) Core SQL statements

Source: Internet
Author: User

Oracle SQL advanced programming learning notes (I) Core SQL statement 1, select statement execution sequence

5   SELECT <column list> 1   FROM <source object list> 1.1  FROM <left source object > <join type >                       JOIN <right source object> ON <on predicates>2   WHERE    <where predicates>3    GROUP BY <group by expressions>4    HAVING      

 

(1) first execute the clause or link clause after the From clause to query the initial dataset. (2) execute the where clause to streamline the initial result set, query the dataset that meets the where condition from the initial dataset. (3) execute the group by clause to aggregate and group the result set from and where query. (4) HAVING clause, in the preceding result set, the condition in the clause is queried as a real dataset. (5) SELECT statement, the columns to be displayed in the final result set are returned. (6) order by clause, sort the queried data sets. Pay attention to the data volume during sorting. If the data volume is small, sort the data in the memory. If the data volume is large, use the temporary disk space, therefore, the data size during sorting is very important. 2. Insert statements to Insert multiple tables
INSERT ALL WHEN <condition1> THEN  INTO <table1>                        WHEN<condition2> THEN INTO <table2>                         ..................................                       SELECT <column list> FROM ........

 

Pay attention to the when condition when using the mark capture query to avoid repeated insertion into multiple tables. 3. The MERGE statement can obtain the dataset to be updated or inserted into the table based on conditions, and then update the table from one or more sources or insert rows into the table.
MERGE 

 

 

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.