title: 3rd highest salary sql
body: <p>I try to get all 3 highest salary from top 5 employees like this </p>
  
  <pre><code>    salary
    35000
    34000
    20000
    12000
    500
    40000
    25000
    41000
    90000
    550000
  </code></pre>
  
  <p>query</p>
  
  <pre><code>select top 5
    (SELECT MAX(grosssalary) FROM Detail) maxsalary ,
     (SELECT MAX(grosssalary) FROM Detail) sec_max_salary,
    (SELECT MAX(grosssalary) FROM Detail
    WHERE grosssalary NOT IN (SELECT MAX(grosssalary) FROM Detail )) as third_max_salary
  </code></pre>
  
  <p>but this shows data like this</p>
  
  <pre><code>maxsalary   sec_max_salary  third_max_salary
  550000       550000            41000
  </code></pre>
  
  <p>where as i want data like this</p>
  
  <pre><code>   maxsalary    sec_max_salary  third_max_salary
      550000       90000            41000
  </code></pre>