--删除重复报告
Select * into #Tmp from Sms_SendHistoryReport
Select min(ReportID) as ReportID into #Tmp2 from #Tmp group by HistoryID,PhoneNum,State,SendTime,IsSended
Select * from #Tmp where ReportID in (Select ReportID from #Tmp2)
delete from Sms_SendHistoryReport where ReportID not in (Select ReportID from #Tmp2)
drop table #Tmp
drop table #Tmp2