Alibabacloud, Database, Query Optimization, Sql, Relational Databases.
lineitem l1, part p WHERE p.partkey = l1.partkey AND p.brand = 'Brand#44' AND p.container = 'WRAP PKG' AND l1.quantity < (SELECT 0.2 * Avg(l2.quantity) FROM lineitem l2 WHERE l2.partkey = p.partkey); In addition, correlated subqueries can also be used anywhere the single line (scalar) is permitted,