how to find the second highest salary from emp table?
Answer Posted / pranav damele
All the above one works with Oracle; this one is for MYSQL
second highest :
mysql> select * from employee group by salary desc limit 1,1;
limit 1,1; first '1' means that bring cursor to the end of record and the next '1' means number of records to be printed after the cursor position.
third highest:
mysql> select * from employee group by salary desc limit 2,1;
limit 2,1; '2' means that bring cursor to the end of 2nd record and the next '1' means number of records to be printed after the cursor position.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can we use insert statement in function?
What are variables in pl sql?
Explain lock escalation? : Transact sql
What is field delimiter?
what are the nonstandard string types? : Sql dba
What is database migration?
how can we destroy the cookie? : Sql dba
Can dml statements be used in pl/sql?
what is the stuff function and how does it differ from the replace function? : Sql dba
Write an sql query to select all records from the table?
Can I learn sql in a week?
Does truncate free space?
What is an exception in pl/sql?
What is the need of a partition key?
Does truncate need commit?