title: Trying to find the second largest value in a column (postgres sql)
body: <p>I am trying to find the second largest value in a column and only the second largest value.</p>
  
  <pre><code>select a.name, max(a.word) as word
  from apple a
  where a.word &lt; (select max(a.word) from apple a)
  group by a.name;
  </code></pre>
  
  <p>For some reason, what I have now returns the second largest value AND all the lower values also but fortunately avoids the largest value.</p>
  
  <p>Is there a way to fix this? </p>