--子查询解决的问题:不能一步求解

来源:互联网 发布:外观设计建模软件 编辑:程序博客网 时间:2024/05/29 18:46

NAME                                                                                                                          

----------------------------      --子查询解决的问题:不能一步求解

SQL> select *

  2  from emp

  3  where sal >(select sal

  4              from emp

  5              where ename='SCOTT');

SQL> --查询工资比Scott高的员工信息

SQL> --1. scott的工资

SQL> select sal from emp where ename='SCOTT';

       SAL                                                                      

----------                                                                      

      3000                                                                      

SQL> --2.3000高的员工

SQL> select *

  2  from emp

  3  where sal>3000;