登录 注册
当前位置:主页 > 资源下载 > 通过子查询来解决问题,这是SQL语言的基础部分

通过子查询来解决问题,这是SQL语言的基础部分

  • 更新:2024-07-07 11:37:50
  • 大小:5.26MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Informix - 数据库
  • 格式:PPT

资源介绍

使用子查询解决问题 谁的工资比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.