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 statement and preparedstatement?
Is foreign key indexed mysql?
What is the difference between mysql_fetch_assoc and mysql_fetch_array?
What is clob datatype?
What is the use of count function in mysql?
What are triggers in mysql?
Can mysql and mariadb coexist?
What is mysql enterprise edition?
What is database migration in mysql?
What is 'mysqlcheck'?
What is the latest version of php and mysql?
How do I stop a query in mysql workbench?
What is the current version of mysql?
What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?
What is the data type for image?