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.
12 May, 2010
Comments (0)
You may also like
Recent Comments
- Siri and Uber also uses Location Services
8 years, 11 months ago
- i connected my dell laptop to videocon lcd ...
9 years ago
- 05/03/2014_22:09:18,97 C:\Users\kampar>touch .htaccess 'touch' is not recognized as ...
9 years, 3 months ago
- IRCTC Tatkal ticket booking script required...
9 years, 4 months ago
- I have a similar solution. I was told ...
10 years ago
- Can you try checking with a different cable ...
10 years, 2 months ago
- wow that's hilarious
10 years, 2 months ago
- Perfect! Thanks! :D
10 years, 2 months ago
- Having the same issue. Were you able to ...
10 years, 2 months ago
- hi im having problem with the hdmi port.. ...
10 years, 2 months ago
- Hi, As of today the way2sms website has ...
10 years, 4 months ago
- HI! I have a problem with my lg ...
10 years, 7 months ago
- You know what would be a GREAT idea ...
10 years, 7 months ago
- Hi, For changing MAC address in win7 just ...
10 years, 7 months ago
- anybody who might read this now should be ...
10 years, 7 months ago