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 values
(1,100),
(2,200),
(3,300);
CREATE TABLE Employee1(
Id INT,
Salary int );
insert into Employee1 values
(1,100);
SELECT MAX(Salary) From Employee WHERE Salary < ( SELECT Max(Salary) FROM Employee);
MAX(Salary) |
---|
200 |
SELECT MAX(Salary) From Employee1 WHERE Salary < ( SELECT Max(Salary) FROM Employee1);
MAX(Salary) |
---|
null |