ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
Alternate approach with OVER clause: - with cte as (SELECT *, COUNT(name) OVER (partition by salary) as cntFROM company)select dense_rank() OVER (order by salary) as team_id, emp_id,name,salaryfrom cte where cnt = 2
Alternate approach with OVER clause: -
with cte as (
SELECT
*,
COUNT(name) OVER (partition by salary) as cnt
FROM company
)
select
dense_rank() OVER (order by salary) as team_id,
emp_id,name,salary
from cte where cnt = 2