【Oracle 官方技术支持】Les18_高级子查询
Hidden Slide Schedule: Timing Topic 60 minutes Lecture 50 minutes Practice 110 minutes Total Lesson Aim In this lesson, you learn how to write multiple-column subqueries and subqueries in the FROM clause of a SELECT statement. You also learn how to solve problems by using scalar, correlated subqueries and the WITH clause. What Is a Subquery? A subquery is a SELECT statement that is embedded in a clause of another SQL statement, called the parent statement. The subquery (inner query) returns a value that is used by the parent statement. Using a nested subquery is equivalent to performing two sequential queries and using the result of the inner query as the search value in the outer query (main query). Subqueries can be used for the following purposes: To provide values for conditions in WHERE, HAVING, and START WITH clauses of SELECT statements To define the set of rows to be inserted into the target table of an INSERT or CREATE TABLE statement To define the set of rows to be included in a view or snapshot in a CREATE VIEW or CREATE SNAPSHOT statement To define one or more values to be assigned to existing rows in an UPDATE statement To define a table to be operated on by a containing query. (You do this by placing the subquery in the FROM clause. This can be done in INSERT, UPDATE, and DELETE statements as well.) Note: A subquery is evaluated once for the entire parent statement. Instructor Note You can skip this slide if the students are already familiar with these concepts. Subqueries You can build powerful statements out of simple ones by using subqueries. Subqueries can be very useful when you need to select rows from a table with a condition that depends on the data in the table itself or some other table. Subqueries are very useful for writing SQL statements that need values based on one or more unknown conditional values. In the syntax: operator includes a comparison operator such as , =, or IN Note: Comparison operators fall into two classe
您可能关注的文档
- 《端午日》课件(40页).ppt
- 《第3课_青海湖_梦幻般的湖》课件_语文版.ppt
- 《端午日》定稿.ppt
- 《电气工程制图》教案(第一章).ppt
- 《第二单元第三节水圈和水循环》课件 鲁教版必修1.ppt
- 《第七章 力》ppt课件.ppt
- 《种子植物》说课.ppt
- 《经济生活》第一轮第一课.ppt
- 《端午日》教学课件(42张PPT).ppt
- 《经济生活》第一课第二节《信用卡、支票和外汇》.pptx
- 山东省惠民县2026届中考语文全真模拟试卷含解析.doc
- 四川省成都市邛崃市达标名校2026届中考语文考前最后一卷含解析.doc
- 期海南省海口五中2026届中考历史四模试卷含解析.doc
- 山东省青岛5中2026届中考历史对点突破模拟试卷含解析.doc
- 黑龙江哈尔滨道外区重点名校2026届中考猜题语文试卷含解析.doc
- 广东省汕尾市海丰县重点名校2026届中考英语五模试卷含答案.doc
- 2026届北京市崇文区重点达标名校中考五模语文试题含解析.doc
- 河南省周口市川汇区18中2026届中考历史押题试卷含解析.doc
- 2026届山东省高青县中考语文模拟试题含解析.doc
- 安徽省合肥市庐江县2026届中考历史最后一模试卷含解析.doc
原创力文档

文档评论(0)