访问SQL删除具有多个值的Dups

时间:2015-04-02 02:51:07

标签: ms-access

我无法调整此SQL编码。我正在尝试查找和删除重复项。当我在status = status和caseid = caseid中查找重复项时,它很有效。但是,如果caseid是重复的并且状态是“Unprocessed”或“Pending Verifs”或“No Packet”,我需要状态才能作为副本删除。我尝试了下面的代码,但我不认为我正在写正确的最后一部分。当WHERE T2.caseid = T1.caseid和T2.status = T1.status时,代码再次起作用。谢谢你的帮助!

DELETE T1.*, T1.CFRRRID
FROM CFRRR AS T1
WHERE (((T1.CFRRRID)>(SELECT MIN(T2.CFRRRID)
  FROM CFRRR T2
  WHERE T2.caseid = T1.caseid AND T2.status = "Unprocessed" OR "Pending Verifs" OR "No Packet" AND = T1.status = "Unprocessed" OR "Pending Verifs" OR "No Packet"
 )));

0 个答案:

没有答案