How to find out the second largest element from mysql table

Answer Posted / neelesh jain

LIMIT <n> == n rows will be returned
OFFSET <n> == skip n rows of the query result

SELECT Salary FROM Employee ORDER BY Salary DESC LIMIT 1
OFFSET 1;

so above query skip 1 element (as offset is 1), which is
biggest and returned 1 elemetn which is 2nd largest value.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we rename database in mysql?

558


How do I run mysql from command line?

570


What are mysql queries?

572


Explain the difference between procedure and function in mysql?

609


Why do we use preparedstatement?

564






Create table employee (eno int(2),ename varchar(10)) ?

638


What are triggers in mysql?

568


What is the difference between b-tree and hash indexes?

536


What could be the reason that the mysql statement 'select avg (salary) from emp' generates an inaccurate output?

576


What is database clustering in mysql?

558


What does "i_am_a_dummy flag" do in mysql?

581


Can mysql handle billions of records?

576


How do I start mysql?

565


What mysql means?

573


How can you plan the logshipping before processing?

1919