how to find the second highest salary from emp table?
Answer Posted / sagar
if the salary is simple non-duplicate salary, you can use
the below queries:
select max(sal) from emp where sal != (select max(sal) from emp)
you can also try
select sal from (select * from emp order by sal desc) where
rownum = 2
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are expressions?
What is a variable in sql?
Can I learn sql in a week?
Name the operator which is used in the query for pattern matching?
What is PL/SQL Records?
How consistent is the view of the data between and within multiple sessions, transactions or statements ?
how many ways we can we find the current date using mysql? : Sql dba
What is lookup table in sql?
What is difference between hql and sql?
What is union and union all keyword in sql and what are their differences?
What do you know by pl/sql cursors?
What is the use of <> sql?
What is exception? What are the types of exceptions?
What is sql basics?
what is the syntax used for partition in tsql? : Transact sql