These were the two questions asked to me during an interview but only condition is to use rank/dense_rank.
Find second highest salary in each department using rank/dense_rank in hive.
- When there are sufficient records in each department.
- When there is only 1 record in few departments.
Guide me if this is even valid or not. If yes then what should be the queries for the same.