How to find out the second largest element from mysql table

Answer Posted / salil

SELECT max( t1.col )
FROM `table` t1
WHERE t1.col < (SELECT max( t2.col ) FROM `table` t2);

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does mysql encrypt passwords?

560


Is mysql distributed?

585


What, if a table has one column defined as TIMESTAMP?

638


What is triggers and how it can be used in mysql?

599


What is different between sql and mysql?

582






What is a table schema?

614


What is sharding in mysql?

578


How to display top 50 rows?

728


What's the latest version of mysql?

600


Why are function needed?

588


How do I connect to mysql database?

583


Is mongodb faster than mysql?

573


What is latest version of mysql?

590


What is general log in mysql?

545


Is postgresql better than mysql?

630