select * from employees
select max(salary) from employees
select max(salary) from employees where salary<(select max(salary) from employees) --second largest
select max(salary) from employees where salary in
(select salary from employees where salary < (select max(salary) from employees)) --second largest
select salary from employees where salary < (select max(salary) from employees) --- displaying salary other than first highest
select * from employees s where 3>=(select count(distinct salary)
from employees where s.salary<=salary) ---largest of three numbers
SELECT * FROM EMPLOYEES
WHERE salary=
(SELECT MAX(salary) FROM EMPLOYEES
WHERE salary != (SELECT MAX(salary) FROM EMPLOYEES)
) ---DOUPLICATE Values also
No comments:
Post a Comment