Answers for "sql query to get the second highest salary"

SQL
1

how to get second highest salary in each department in sql

SELECT E.Employers_name, E.dep_number, E.salary
FROM Employers E
WHERE 1 = (SELECT COUNT(DISTINCT salary) 
        FROM Employers B 
        WHERE B.salary > E.salary AND E.dep_number = B.dep_number)
group by E.dep_number
Posted by: Guest on January-28-2021
0

sql 2nd highest salary

select *from employee 
group by salary 
order by  salary desc limit 1,1;
Posted by: Guest on September-06-2021
0

write sql query to find the second highest salary of employee

SELECT MAX(Salary) From Employee
 WHERE Salary < ( SELECT Max(Salary) FROM Employee);
Posted by: Guest on November-07-2021
0

sql highest salary by location

/*  Highest salary by Department/Location   */
SELECT e.ename, e.sal, e.deptno, d.loc
FROM emp e
JOIN dept d
ON e.deptno = d.deptno
WHERE e.sal in
( 	
  	select max(sal) 
  	from emp 
  	group by deptno
)
Posted by: Guest on June-28-2020

Code answers related to "sql query to get the second highest salary"

Code answers related to "SQL"

Browse Popular Code Answers by Language