I am trying to find the second largest value in a column and only the second largest value.

select a.name, max(a.word) as word
from apple a
where a.word < (select max(a.word) from apple a)
group by a.name;

For some reason, what I have now returns the second largest value AND all the lower values also but fortunately avoids the largest value.

Is there a way to fix this?

Edit
Report