Max - Min
create table emp(
no integer primary key
,name varchar2(20) not null
,salary number(10)
);
insert into emp(no, name, salary)
values (1,'Nancy',30000);
insert into emp(no, name, salary)
values (2,'Tom', 40000);
insert into emp(no, name, salary)
values (3,'Jack', 30000);
insert into emp(no, name, salary)
values (4,'Jason',10000);
select max(salary) - min(salary) from emp;
MAX(SALARY)-MIN(SALARY)
-----------------------
30000
1 row selected.
drop table emp;
Related examples in the same category