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
What are the events on which a database trigger can be based?
explain about mysql and its features. : Sql dba
What are all the ddl commands?
How do I create an index in word?
What is PL/SQL Records?
What are sql commands?
What is sql resultset?
What is sqlite format?
Can you sum a count in sql?
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
what is “go” in t-sql? : Transact sql
Where do we use pl sql?
Can we use delete in merge statement?
What are the most important characteristics of pl/sql?
what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba