【问题标题】:how to select count in oracleoracle中如何选择计数
【发布时间】:2018-04-17 01:48:42
【问题描述】:

enter image description here

如何计算job_title的工资?

我尝试过这样的编码,但结果错误 这是我的代码

select a.job_id,a.job_title,avg(b.salary) gaji_rata_rata 
from jobs a, employees b where a.job_id=b.job_id  order by job_id;

【问题讨论】:

    标签: oracle select count


    【解决方案1】:

    使用聚合函数时需要分组

    select a.job_id,a.job_title,avg(b.salary) gaji_rata_rata 
    from jobs a, employees b 
    where a.job_id=b.job_id  
    group by  a.job_id,a.job_title
    order by job_id;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-02
      • 1970-01-01
      • 2022-11-25
      • 1970-01-01
      • 2021-11-24
      • 2019-10-02
      • 1970-01-01
      • 2015-07-07
      相关资源
      最近更新 更多