2021-04-28|2021-04-28 sql 去重

select A.* FROM THDataNow_Info A , (SELECT THNow_EquipID,THNow_NodeID,THNow_EquipType FROM THDataNow_Info GROUP BY THNow_EquipID,THNow_NodeID,THNow_EquipType HAVING COUNT(*) > 1 ) B WHERE A.THNow_EquipID=B.THNow_EquipID AND a.THNow_NodeID= b.THNow_NodeID and a.THNow_EquipType= b.THNow_EquipType AND A.THDataNow_ID NOT IN (SELECT MIN(THDataNow_ID) AS ID FROM THDataNow_Info GROUP BY THNow_EquipID,THNow_NodeID,THNow_EquipType HAVING COUNT(*) > 1)

    推荐阅读