Interviewer And Interviewee Guide

Oracle SQL Interview Question:

How to find out nth highest salary from emp table?

Submitted by: Administrator
SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal);
For Eg:-
Enter value for n: 2
SAL
---------
3700
Submitted by: Administrator

Read Online Oracle SQL Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.