Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query to get 3rd largest amount and 2nd largest amount from table

Tags:

sql

How to find 2nd and 3rd largest amount from a table

like image 752
Jibu P C_Adoor Avatar asked May 19 '10 12:05

Jibu P C_Adoor


1 Answers

SELECT ... FROM ... ORDER BY column DESC LIMIT 2 OFFSET 1;

Depending on your SQL dialect there's a different way of specifying LIMIT and OFFSET.

like image 141
ThiefMaster Avatar answered Sep 20 '22 06:09

ThiefMaster