Help the world stop coronavirus! Stay home!

Prev Next

Hibernate / SQL

What is the simplest way to find the second largest value using SQL?

To find the second largest, Use the max aggregate function to find the largest and filter the largest value and find the maximum value again that yields the second largest.

SELECT MAX( column)
  FROM table
 WHERE column< ( SELECT MAX( column)
                 FROM table )

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Maven

Comments & Discussions