SQL语句怎么剔除多个条件重复数据

如题所述

如下面的语句可以查询
empid(员工工号)
重复(大于
1
次)的纪录
select
empid,
count(*)
from
employee
group
by
empid
having
count(*)
>
1;
还可以用下面的语句查询重复员工的详细记录
select
*
from
employee
where
empid
in
(select
empid
from
employee
group
by
empid
having
count(*)
>
1)
;
温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜