+ 2
how to find second the second maximum in a column using a subquery
subquery
4 Réponses
+ 2
select Max(columna) as secondmax from table where columna not in ( select Max(columna) from table);
+ 2
jose's answer is correct, you can also try,
SELECT column FROM table WHERE column < MAX(column) ORDER BY column DESC LIMIT 1;
+ 1
SELECT column FROM table WHERE column < MAX(column) ORDER BY column DESC LIMIT 1;
- 5
YouStupidFuckingBitch