Featured Post

What is the purpose of the php.ini file?

  The PHP configuration file,   php.ini , is the final and most immediate way to affect PHP's functionality. The php.ini file is read ea...

How to find the top 2 salaried employees in each department

Let us take the table having different departments

Table Name:-  employee

+------+------------+------------+--------------+
| id   | dept_name  |  emp_name  |      salary  |
+------+------------+------------+--------------+
|    1 | ECE        | Raj        |        10000 |
|    2 | ECE        | Ravi       |        12000 |
|    3 | ECE        | Malli      |        14000 |
|    4 | CSE        | Madhav     |        12000 |
|    5 | CSE        | Jaani      |        14000 |
|    6 | CSE        | Jack       |        15000 |
|    7 | IT         | Mill       |        16000 |
|    8 | IT         | Pawan      |        17000 |
|    9 | IT         | Jack       |        18000 |
+------+------------+------------+--------------+
 
From above table for top 2 salaried employees see below query

Popular Posts