Home
Contact
About
Navigation
Home
Interview Questions
Tutorials
Video Tutorials
Home
»
Teradata Interview Questions
»
Query to find the highest 3 salaries in a department
Query to find the highest 3 salaries in a department
in
Teradata Interview Questions
- on 03:22 -
No comments
SELECT emp_no ,RANK() OVER (ORDER BY salary DESC)"rank" FROM emp_table QUALIFY rank < 3( if there is only one dept) SELECT emp_no,RANK() OVER(PARTITION BY dept_id ORDER BY salary DESC) as hig_sal FROM emp_table QUALIFY high_sal < 3(mul depts)
Tweet
Post a Comment
Newer Post
Older Post
Home
Categories
Teradata Interview Questions
Recent Comments
Popular Posts
Live Traffic Stats
Post a Comment