how to find the second highest salary from emp table?
Answer Posted / prudhvi
select sal from emp a where 1=(select count(*) from emp b where a.sal>b.sal);
Try this guys,if u want highest sal use 0 in where condition, for second highest 1,third 2........
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
what is the difference between truncate and drop statements? : Sql dba
What is the difference between explicit and implicit cursors in oracle?
What does trigger mean in slang?
What is a sql profiler?
How can you know that statistics should be updated?
How to add, remove, modify users using sql?
What mean sql?
Can we connect to postgresql using sql developer?
Differentiate between sga and pga.
what are the security recommendations while using mysql? : Sql dba
What is the maximum number of columns in sql table?
Is primary key a clustered index?
How many joins can you have in sql?
What is input buffer in sql*plus?
what is the difference between clustered and non clustered index in sql? : Sql dba