“Nilai tertinggi ke -3 di SQL” Kode Jawaban

Nilai tertinggi ke -3 di SQL

-- creating Employee table in Oracle
CREATE TABLE Employee (name varchar(10), salary int);

-- inserting sample data into Employee table
INSERT INTO Employee VALUES ('Rick', 3000);
INSERT INTO Employee VALUES ('John', 4000);
INSERT INTO Employee VALUES ('Shane', 3000);
INSERT INTO Employee VALUES ('Peter', 5000);
INSERT INTO Employee VALUES ('Jackob', 7000);

SELECT TOP 1 salary 
FROM (
  SELECT DISTINCT TOP 3 salary FROM Employee ORDER BY salary DESC 
  ) AS temp 
ORDER BY salary


Tiny Coders

Nilai tertinggi ke -2 di SQL

-- creating Employee table in Oracle
CREATE TABLE Employee (name varchar(10), salary int);

-- inserting sample data into Employee table
INSERT INTO Employee VALUES ('Rick', 3000);
INSERT INTO Employee VALUES ('John', 4000);
INSERT INTO Employee VALUES ('Shane', 3000);
INSERT INTO Employee VALUES ('Peter', 5000);
INSERT INTO Employee VALUES ('Jackob', 7000);

SELECT TOP 1 salary 
FROM (
  SELECT DISTINCT TOP 2 salary FROM Employee ORDER BY salary DESC 
  ) AS temp 
ORDER BY salary
Tiny Coders

Jawaban yang mirip dengan “Nilai tertinggi ke -3 di SQL”

Pertanyaan yang mirip dengan “Nilai tertinggi ke -3 di SQL”

Lebih banyak jawaban terkait untuk “Nilai tertinggi ke -3 di SQL” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya