“Gaji MAX 3 di SQL” Kode Jawaban

n Gaji tertinggi di SQL

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP N salary
FROM #Employee
ORDER BY salary DESC
) AS temp
ORDER BY salary
Clumsy Cockroach

Gaji tertinggi di SQL

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; 
Obedient Ocelot

Gaji MAX 3 di SQL

SELECT salary, first_name, last_name FROM employees
ORDER BY salary DESC LIMIT 3;
Obedient Ocelot

gaji maksimal kedua di SQL

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

gaji dan nama maks di SQL

SELECT FIRST_NAME , SALARY
FROM EMPLOYEES
WHERE SALARY IN (SELECT MAX(SALARY)AS RESULT FROM EMPLOYEES
UNION
SELECT MIN(SALARY)AS RESULT FROM EMPLOYEES);
Obedient Ocelot

Jawaban yang mirip dengan “Gaji MAX 3 di SQL”

Pertanyaan yang mirip dengan “Gaji MAX 3 di SQL”

Lebih banyak jawaban terkait untuk “Gaji MAX 3 di SQL” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya