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
What is difference between mysql and mysql server?
How to present a past time in hours, minutes and seconds?
What is mysql in dbms?
Why is mysql popular?
What are federated tables?
How do I start mysql in linux?
Where’s database data actually stored?
how you will show all records not containing the name "sonia" and the phone number '9876543210' order by the phone_number field.
What is index length in mysql?
What is the use of i-am-a-dummy flag in mysql?
How to dump one database for backup.
How many columns can a table have?
What are the reasons for selecting lamp (linux, apache, mysql, php) instead of combination of other software programs, servers and operating systems?
Explain the difference between delete and truncate.
Is mysql connect deprecated?