你的数据库表的主键是什么啊?设为primarykey吧 以下查询语句就行了 select * from RealTimeData r where exists(select * from RealTimeData where realtime=r.realtime and machineid=r.machineid and primarykey!=r.primarykey)
不知道你数据库类型,存储过程你自己写好了
无主键的话就有点难查了,因为查询的时候会查到自己的,你后面在加上剩下的所有字段 create proc sel_duplicate as select * from RealTimeData r where exists(select * from RealTimeData where realtime=r.realtime and machineid=r.machineid and flux!=r. flux and pressure!=r.pressure 等等) go