SQL中查询有三个字段的记录相同的语句
发布网友
发布时间:2022-05-06 23:18
我来回答
共2个回答
热心网友
时间:2023-10-05 05:15
Select * from PRDT as p1 , PRDT as p2 where p1.NAME=p2.NAME and p1.SPC=p2.SPC and p1.UT=p2.UT
你试试吧,我学的时候老师出过这种题目,好长时间了,都忘了;
就是把这个表看成是两张表来查
热心网友
时间:2023-10-05 05:16
select a.* from PRDT a
inner join
(select Name,SPC,UT from PRDT
group by Name,SPC,UT
having count(*) > 1) b
on a.Name = b.Name and a.SPC = b.SPC and a.UT = b.UT
没有环境,不过差不多