zoukankan      html  css  js  c++  java
  • Oracle篇 之 子查询

    子查询:先执行内部再外部

    Select last_name,salary,dept_id

    From s_emp

    Where dept_id in (

    Select dept_id

    From s_emp

    Where dept_id is not null

    );

    Select last_name,dept_id

    From s_emp

    Where dept_id = (

    Select dept_id

    From s_emp

    Where last_name=’Smith’

    );

    Select salary,last_name

    From s_emp

    Where salary<(

    Select avg(salary)

    From s_emp

    );

    Select last_name,dept_id,title

    From s_emp

    Where dept_id =(

    Select dept_id

    From s_emp

    Where last_name=’Smith’

    ) and tltle = (select tltle

    From s_emp

    Where last_name=’Smith’

    );

    Select rownum,last_name,salary

    From s_emp

    Where rownum<=20

    minus

    Select rownum,last_name,salary

    From s_emp

    Where rownum<=10

    ;

  • 相关阅读:
    敏捷软件开发实践-Code Review Process(转)
    随笔1
    随笔
    随笔
    低级错误
    随笔
    随笔2
    随笔
    这以前写的代码
    蛋疼的vs
  • 原文地址:https://www.cnblogs.com/wskb/p/10758646.html
Copyright © 2011-2022 走看看