Answers for "first max salary in sql"

SQL
1

second max salary in sql

SELECT MAX(SALARY) 'SECOND_MAX' FROM EMPLOYEES
WHERE SALARY <> (SELECT MAX(SALARY) FROM EMPLOYEES);
Posted by: Guest on November-27-2020
0

second highest salary in sql

SELECT MAX(SALARY) 'SECOND_MAX' FROM EMPLOYEES
WHERE SALARY <> (SELECT MAX(SALARY) FROM EMPLOYEES);


OR

Here is the solution for nth highest
salary from employees table 

SELECT FIRST_NAME , SALARY FROM 
(SELECT FIRST_NAME, SALARY, DENSE_RANK() OVER
(ORDER BY SALARY DESC) AS SALARY_RANK
FROM EMPLOYEES)
WHERE SALARY_RANK = n;
Posted by: Guest on January-07-2021
0

first max salary in sql

SELECT first-name
FROM employees
WHERE salary = (SELECT MAX(salary) FROM employees);
Posted by: Guest on January-28-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
0

how to get employee having maximum experience in mysql

select max(salary), dept_id from employee where salary not in(select max(salary) from employee) group by dept_id;
Posted by: Guest on November-02-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language