how to find the second highest salary from emp table?
Answer Posted / mohammed irfan
SELECT sal1 "salary"
FROM (SELECT ROWNUM rownum1 ,sal1
FROM (SELECT sal sal1
FROM emp
ORDER BY sal DESC
)
)
WHERE rownum1=:p_highest;
Note:- 'p_highest' here we can give the number as we want
to display the highest salary.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
what is sql? : Sql dba
What is linq to sql?
What does 0 mean in sql?
how many columns can be used for creating index? : Sql dba
what is primary key? : Sql dba
What is the difference between sum and count in sql?
Can we use joins in subquery?
What is blind sql injection?
Why function is used in sql?
What is a schema? How is it useful in sql servers?
What is the usage of sql functions?
Can we write ddl statements in functions?
Is pl sql and postgresql same?
What is a mutating table and a constraining table?
How much does sqlite cost?