登录 注册
当前位置:主页 > 资源下载 > SQL语言基础包括使用子查询的技巧

SQL语言基础包括使用子查询的技巧

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

资源介绍

使用子查询 * SQL> SELECT ename 2 FROM emp 3 WHERE sal > 4 (SELECT sal 5 FROM emp 6 WHERE empno=7566); ENAME ---------- KING FORD SCOTT 2975 * SELECT ename FROM emp WHERE sal > (SELECT sal FROM emp WHERE empno=7566); Using a Subquery In the slide, the inner query determines the salary of employee 7566. The outer query takes the result of the inner query and uses this result to display all the employees who earn more than this amount. Instructor Note Execute the subquery (inner query) on its own first to show the value that the subquery returns. Then execute the outer query using the result returned by the inner query. Finally, execute the entire query (containing the subquery) and show that the result is the same.