Beckham _ mysql three-seed query _ MySQL

Source: Internet
Author: User
Mysql three-seed query: I. three seed query II. three seed query comprehension Model I. mysql three seed query where subquery, from subquery, and exists subquery II. Understanding model: 21. a good model for us to understand. When we write an SQL statement MysqlTri-seed query Brief:
Seed 1 and 3
II. seed query comprehension model

I. mysql three-seed query

Where subquery, from subquery, and exists subquery

II. Understanding the model:

2.1. a good model for us to understand. When writing an SQL statement, you can understand the following points:

A. where expression. Place the expression in the row to check whether the expression is true.

B. column: It is considered a variable and can be computed.

C. The result can be understood as a temporary table.

2.2. understand the three-seed query

1. where subquery

Consider the result of the inner query as a comparison condition of the outer query.

Detailed: select field from table where inner result

Run: run the where statement first to obtain the result of the inner layer. Execute outer layer

2. from subquery

Use the internal query result as a temporary table for the outer SQL to query again

Details: select field from (from subquery)

Run: execute the from statement first to obtain the inner result. Execute outer layer

3. exists subquery

Obtain the outer query result to the inner layer. Check whether the query on the inner layer is true.

This process is based on the query result to the outer layer, and a row is substituted into the inner layer to determine whether the result is true or not. That is, whether the statement after exists is true. If it is true, this line is displayed. Otherwise, no.

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.