inner join with group by expression in oracle sql [duplicate]

强颜欢笑 提交于 2019-12-03 23:46:49
Dan Bracuk

The error message is a bit misleading. When you select a bunch of fields and an aggregate, you have to group by every field you select and only the fields you select. So your query has to be:

select j.job_title, e.job_ID, count(e.job_ID)
from employees e, jobs j
where e.job_id=j.job_id
group by e.job_Id, j.job_title
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!