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
Can we rename database in mysql?
How do I run mysql from command line?
What are mysql queries?
Explain the difference between procedure and function in mysql?
Why do we use preparedstatement?
Create table employee (eno int(2),ename varchar(10)) ?
What are triggers in mysql?
What is the difference between b-tree and hash indexes?
What could be the reason that the mysql statement 'select avg (salary) from emp' generates an inaccurate output?
What is database clustering in mysql?
What does "i_am_a_dummy flag" do in mysql?
Can mysql handle billions of records?
How do I start mysql?
What mysql means?
How can you plan the logshipping before processing?