只筛选一个字段值相同的记录
select * from A where PDDT in(
select PDDT FROM A
group by PDDT
having count(PDDT)>1
)
筛选多个字段值相同的的记录
SELECT COUNT(*),DeptID, PDDT , DLNo , DLNoRe, MacNo
FROM A
GROUP BY DeptID, PDDT , DLNo , DLNoRe, MacNo
having count(*)>1
原文地址:http://blog.51cto.com/alun51cto/2114325
时间: 2024-10-13 17:08:54