我知道access是用IF来判断,我写个case when的判断,你自己更改 假设还有个字段ID记录不同的记录(行号) select m.* from ( select case when t1.身份证号 = t2.身份证号 then 1 else 0 end + case when t1.收据编号 = t2.收据编号 then 1 else 0 end + case when t1.协议编号 = t2.协议编号 then 1 else 0 end + case when t1.金额 = t2.金额 then 1 else 0 end + case when t1.姓名 = t2.姓名 then 1 else 0 end cnt from tb t1 , tb t2 where t1.id <> t2.id ) m where cnt >= 2此问题在这里有个类似的. http://topic.csdn.net/u/20111029/16/4e23cb0b-dccd-4323-b318-9e147a95c81a.html
假设还有个字段ID记录不同的记录(行号)
select m.* from
(
select case when t1.身份证号 = t2.身份证号 then 1 else 0 end +
case when t1.收据编号 = t2.收据编号 then 1 else 0 end +
case when t1.协议编号 = t2.协议编号 then 1 else 0 end +
case when t1.金额 = t2.金额 then 1 else 0 end +
case when t1.姓名 = t2.姓名 then 1 else 0 end cnt
from tb t1 , tb t2
where t1.id <> t2.id
) m
where cnt >= 2此问题在这里有个类似的.
http://topic.csdn.net/u/20111029/16/4e23cb0b-dccd-4323-b318-9e147a95c81a.html