title: Can anyone tell me, How this query works?
body: <p>Can anyone explain me how this query will work and find nth highest salary from salary table.</p>
  
  <pre><code>SELECT salary FROM salary_master s1 
  WHERE (n-1) = (SELECT COUNT(*) FROM salary_master WHERE salary &gt; s1.salary)
  </code></pre>
  
  <p>I mean, this query will iterate through all values?</p>
  
  <p>Help me.</p>