title: Get top 3 salaries columnwise department wise in employee table?
body: <p>There are 2 tables :-<br>
  The Employee table holds all employees.   </p>
  
  <pre><code>+----+-------+--------+--------------+  
  | Id | Name  | Sa1ary | DepartmentId |   
  +----+-------+--------+--------------+  
  |  1 | Joe   |  70000 |            1 |  
  |  2 | Henry |  80000 |            2 |  
  |  3 | Sam   |  60000 |            2 |  
  |  4 | Max   |  90000 |            3 |  
  |  5 | Janet |  69000 |            4 |  
  |  6 | Randy |  85000 |            1 |  
  +----+-------+--------+--------------+  
  </code></pre>
  
  <p>Department table is as follows:-   </p>
  
  <pre><code>+----+------------+      
  |DID |  DNAME     |   
  +----+------------+  
  |1   |  IT        |  
  |2   |  ADMIN     |  
  |3   |  HR        |  
  |4   |  MARKETING |  
  |5   |  SALES     |  
  +----+------------+   
  </code></pre>
  
  <p>output should be :-  </p>
  
  <pre><code>+-----+--------+--------+------+------+  
  |Dname| Best    |Seond best |  Worst |  
  +-----+--------+--------+------+------+  
  |IT   |  40000  |30000  |10000        |  
  +-----+--------+--------+------+------+    
  |ADMIN| 50000   |   |50000        |   
  +-----+--------+--------+------+------+  
  |HR   | 70000   |60000  |60000        |   
  +-----+--------+--------+------+------+  
  </code></pre>
  
  <p>we have to consider maximum,second maximum and 3 maximum salary from each department.</p>