1. When comparing a set of records in a certain part of a table, the difference between a common subquery and an associated subquery can be used. When compared in a subdivided group, you need to use associated subqueries. The associated subquery is usually used in a language such as "limitation (binding)" or "restriction.
Key point: the key here is the condition of the WHERE clause added to the subquery. This condition specifies that the sales unit price and average unit price of each item are compared in the same product. Note: When using an associated subquery, you must add the table alias before the column name corresponding to the table and describe it in the form of "<Table Name>. <column Name>.
2. Associated subqueries are also used to split the set. From another perspective, in fact, the associated subquery is the same as the group by clause, and the set can be split.
3. The conditions must be written in the scope of the Association name in the subquery. The Association name has a valid range limit. Specifically, the Association name set in the subquery can only be used within the subquery. That is, "the internal can see the external, but the external can not see the internal ".
Chapter 5 complex queries 5-3 associated subqueries