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
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
Subscribe to:
Posts (Atom)
Popular Posts
-
You can find maximum salary for each department by grouping all records by DeptId and then using MAX() function to calculate maximum sala...
-
Answer: select * from emp where hiredate < (’01-jan-81’);