how to find the second highest salary from emp table?
Answer Posted / ramesh lavanuru
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 ? | 52 Yes | 63 No |
Post New Answer View All Answers
What is a table in a database?
Can a trigger call a stored procedure?
Why sql query is slow?
how can you create an empty table from an existing table? : Sql dba
write an sql query to find names of employee start with 'a'? : Sql dba
What is a relationship and what are they?
Does varchar need length?
What is the process of debugging?
Which type of cursor is used to execute the dml statement?
Enlist some predefined exceptions?
What do you mean by dbms? What are its different types?
Can we use the cursor's to create the collection in PL/SQL?
How do you concatenate in sql?
What is the usage of nvl function?
Why is stored procedure faster than query?