how to find the second highest salary from emp table?
Answer Posted / ram achare
for 2nd highest salary
select sal from(select distinct sal from emp order by sal desc limit 2)emp order by salary limit 1;
for 3rd highest salary
select sal from(select distinct sal from emp order by sal desc limit 3)emp order by salary limit 1;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is log shipping? : Sql dba
How many sql statements are used?
how to include character strings in sql statements? : Sql dba
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba
What are the possible values that can be stored in a boolean data field?
How do we use distinct statement? What is its use?
what happens if you no create privilege in a database? : Sql dba
What is a temporal data type?
How is indexing done in search engines?
when MSQL8.0 is in market
what are the type of locks ? : Sql dba
What are the two types of periodical indexes?
What is date functions?
What is the cause of mutating table error and how can we solve it?
what are the difference between clustered and a non-clustered index? : Sql dba