Answers for "maximum element in sql"

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

Code answers related to "maximum element in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language