66问答网
所有问题
SQL语句怎么剔除多个条件重复数据
如题所述
举报该问题
推荐答案 2019-12-19
如下面的语句可以查询
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)
;
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://66.wendadaohang.com/zd/2ix2x9pssv9UisiDUn.html
相似回答
大家正在搜