Answers for "Write a SQL query to find the 4th maximum element from a table"

SQL
0

maximum element in sql

Who is the person getting 1st max salary
SELECT first-name
FROM employees
WHERE salary = (SELECT MAX(salary) FROM employees);

2nd max salary=
SELECT first-name , salary
FROM employees
WHERE salary = (SELECT MAX(salary) FROM employees WHERE salary NOT IN
(SELECT MAX(salary) FROM employees));

3rd max salary=
SELECT * FROM employees
WHERE salary = (SELECT * FROM (SELECT DISTINCT salary FROM employees
ORDER BY salary DESC) WHERE ROW NUM <=3
MINUS
SELECT * FROM (SELECT DISTINCT salary FROM employees
ORDER BY salary DESC) WHERE ROW NUM <=2);
Posted by: Guest on January-28-2021
0

n highest salary in sql

SELECT salary FROM Employee ORDER BY salary DESC LIMIT N-1, 1
Posted by: Guest on February-07-2020

Code answers related to "Write a SQL query to find the 4th maximum element from a table"

Code answers related to "SQL"

Browse Popular Code Answers by Language