add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table Employee (Id int, salary int);
insert into Employee select 1,5;
insert into Employee select 2,7;
insert into Employee select 3,9;
insert into Employee select 4,3;
insert into Employee select 5,9;
select Salary
from
(select 2 as s) choice
left join (
select salary, dense_rank() over(order by salary desc) rnk
from Employee
)s on s.rnk = s;
Salary
7
create table Employee2 (Id int, salary int);
insert into Employee2 select 3,9;
insert into Employee2 select 5,9;
select Salary
from
(select 2 as s) choice
left join (
select salary, dense_rank() over(order by salary desc) rnk
from Employee2
)s on s.rnk = s;
Salary
null