with cte as (select * from employee e1 where not exists ( select 1 from employee e2 where e1.emp_id = e2.manager_id)), cte2 as (select department ,emp_id, dense_rank() over(partition by department order by salary desc ) as dnk from cte) select department, emp_id,dnk from cte2 where dnk= 1;
with cte as (select * from employee e1
where not exists ( select 1 from employee e2
where e1.emp_id = e2.manager_id)),
cte2 as (select department ,emp_id, dense_rank() over(partition by department order by salary desc ) as dnk from cte)
select department, emp_id,dnk from cte2
where dnk= 1;
Bro please provide create and insert statement. Already you have made so many videos. These things shouldn't be reminded.😢😢😢😢
Always collect it from our telegram channel when it's not given in description.
Bro first add the question in either comments or description section.