12 May, 2010

Select second largest value in a column using SQL

The answer is pretty simple without jumping over hoops or thinking about taking MAX etc.
SELECT value FROM table ORDER BY value DESC LIMIT 1,1

Why LIMIT 1,1 ? Shouldnt it be 2,1

Think again. LIMIT 0,1 is the first record.
Comments (0) Post a comment
You may also like



Email Newsletter
Email:
Popular Posts
Recent Posts
Tags
Random photo
Tropical Canopy @ Havelock Tropical Canopy @ Havelock in Havelock Island Andaman
On Facebook
Recent Comments


digitalpbk