1.查询重复的记录
select * from employee group by emp_id having count (*)>1;
2.删除重复的记录
(1 )通过建立临时表来实现
SQL>create table temp_emp as (select distinct * from employee)
SQL> truncate table employee; (清空employee表的数据)
SQL> insert into employee select distinct * from temp_emp; (再将临时表里的内容插回来)
(2)通过rowid。
SQL>delete from employee where rowid not in (select max(t1.rowid) from employee t1 group by
t1.emp_id);