使用子查询-SQL语言基础

时间:2021-04-25 19:38:21
【文件属性】:
文件名称:使用子查询-SQL语言基础
文件大小:5.26MB
文件格式:PPT
更新时间:2021-04-25 19:38:21
SQL 基础 使用子查询 * 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.

网友评论