-
通过子查询来解决问题,这是SQL语言的基础部分
资源介绍
使用子查询解决问题
谁的工资比Jones多?
*
“哪一位员工的工资比 Jones的薪水高?”
主查询
?
“Jones的薪水是多少?”
?
子查询
*
Using a Subquery to Solve a Problem
Suppose you want to write a query to find out who earns a salary greater than Jones’ salary.
To solve this problem, you need two queries: one query to find what Jones earns and a second query to find who earns more than that amount.
You can solve this problem by combining the two queries, placing one query inside the other query.
The inner query or the subquery returns a value that is used by the outer query or the main query. Using a subquery is equivalent to performing two sequential queries and using the result of the first query as the search value in the second query.
- 上一篇: 第六部分-SQL语言基础
- 下一篇: INFORMIX数据库重要配置文件-INFORMIX数据库基础