with cte as ( select o.*,sum(salary) over (partition by experience order by salary) as cumm from office o) --select max(cumm) from cte where experience='Senior' and cumm
Using Nested cte's I know this is a bit crumpy and lot of lines but just another approach With senior as ( select *, sum(salary) over (order by salary asc) AS senior_cum from office where experience = 'Senior'), selected_seniors as ( select emp_id, experience, salary from senior where senior_cum
Really Informative video.. I got to learn a lot.. Thanks.👌
Thanks, I'm glad you found it helpful!
with cte as (
select o.*,sum(salary) over (partition by experience order by salary) as cumm from office o)
--select max(cumm) from cte where experience='Senior' and cumm
What is the level of this question?
Easy
Medium
Hard
medium
Using Nested cte's
I know this is a bit crumpy and lot of lines but just another approach
With senior as ( select *, sum(salary) over (order by salary asc) AS senior_cum from office where experience = 'Senior'),
selected_seniors as ( select emp_id, experience, salary from senior where senior_cum
nice one.