--删除重复数据delete from PMS_Contract_LeasedRoom where LeasedRoomId not in(select max(LeasedRoomId) from PMS_Contract_LeasedRoom group by ContractCode,RoomCode) --having count(*)>1)