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 longblob?
What is mysql command line?
How do I backup mysql database on linux?
What is pdo :: fetch_assoc?
Why we use mysqli instead of mysql?
How many sql ddl commands are supported by 'mysql'?
What is the query to display top 20 rows?
SQL is not case sensitive. DELETE is the same as delete. State Whether True or False?
How do I transfer data from one database to another in mysql?
Why is mysql used?
What is mysql database extension?
what is the difference between gui testing and database testing? : Mysql dba
what is mysql optimization in brief?
How to drop an existing view in mysql?
How does triggers work in mysql?