I'm beginner in Oracle and I was wondering why I cannot make sum out of count function. Here's the example of my queries and tries:
select job_id, SUM(count(job_id)) as "jobs"
from employees
group by job_id
error:
ORA-00937: not a single-group group function
I also tried to use cte but to my surprise I can't:
with cte1 as (
select job_id, count(job_id) as "jobs"
from employees
group by job_id
)
select sum(jobs) from cte1
ORA-00904: "JOBS": invalid identifier