利用 distinct 關鍵字過濾重復的行,將查詢的結果寫入臨時表
select distinct * into #temp from mytable
刪除原表的數據
delete mytable
將臨時表插入到表中
insert mytable select * from #temp
釋放臨時表
drop table #temp
刪除數據行是NULL的
delete from mytable where time is null
update table set [coulms]='new-values' where [coulms]='values' and year(備份時間)=2019 and Month(備份時間)=11 and DAY(備份時間)=13