count distinct column value
create table employee(
emp_no integer primary key
,name varchar2(20) not null
);
insert into employee(emp_no, name)
values (1,'Nancy');
insert into employee(emp_no, name)
values (2,'Tom');
insert into employee(emp_no, name)
values (3,'Jason');
insert into employee(emp_no, name)
values (4,'Tom');
select count(distinct name) from employee;
COUNT(DISTINCTNAME)
-------------------
3
drop table employee;
Related examples in the same category