from employees e
where e.department_id between 30 and 90
group by e.job_id,rollup(e.first_name);
I need a replacement of this query which should perform in better way with the same logic .The above query count(distinct) taking much time because there are huge no. of records in the table so mainly need an alternative for this count(distinct).