Hive Solution
3.Hive Solution
SELECT a.* FROM
(select *,
count()OVER (PARTITION BY company) cnt,
row_number()OVER (PARTITION BY company ORDER BY salary) as rn
from leetcode.ex_569_employee) a
where rn between cnt/2 and (cnt/2)+1
;
PreviousExercise 3:569.Median Employee SalaryNextExercise 4:571.Find Median Given Frequency of Numbers
Last updated