技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> Oracle --> oracle 子查询写法

oracle 子查询写法

浏览:2257次  出处信息

    1

    select sub_table.num,sub_table.job_id

    from (

    select count(*) as num,t.job_id 

    from dir_irai t group by t.job_id order by num desc

    ) 

    sub_table where sub_table.num>1

    2   

    select distinct sub_table.num,t2.job_id,t2.anken_id,t2.job_id

    from (

    select count(*) as num,t.job_id 

    from dir_irai t group by t.job_id order by num desc

    ) 

    sub_table,dir_irai t2 where sub_table.num>1 and sub_table.job_id=t2.job_id order by t2.job_id 

建议继续学习:

  1. 改变了对Mysql子查询的看法    (阅读:2977)
  2. WebGame行业案例:in子查询group by引发的“血案”    (阅读:1894)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1