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
Explain spool.
what is a relationship and what are they? : Sql dba
What is the use of index in sql?
Can a foreign key be null?
Can a key be both primary and foreign?
What are the usages of sql?
How to connect a sql*plus session to an oracle server?
Can we write ddl statements in functions?
Can a table contain multiple primary key’s?
What is compiled query?
Does sql full backup truncate logs?
Can we create index on primary key?
what is the use of set statement in tsql? : Transact sql
What is a natural join?
Define implicit and explicit cursors.