我在MS Access中有一个表,我必须找到重复的电子邮件,其中频道和政策类型不同。
我写下面的查询,但它不按我想要的方式工作。它在Channel和Policy类型中也有重复值。
所以结果看起来像这样;
Email Channel Policy
xyz@abc.com IA H
xyz@abc.com IA P
我想要的结果应该是什么;
Email Channel Policy
xyz@abc.com IA H
xyz@abc.com DIR P
这是查询;
SELECT Master.Email, Master.Channel, Master.PolicyNumber, Master.PolicyType
FROM Master
WHERE (((Master.Email) In
(SELECT [Email]
FROM [Master] As Tmp
GROUP BY [Email]
HAVING Count(*)>1 )))
ORDER BY Master.Email;