alter table add id int identity(1,1)
delete a from table a
where exists(select 1 from table b where a.s/n = b.s/n and a.old_sn = b.old_sn and a.new_sn = b.new_sn and a.scan_datetime = b.scan_datetime and a.id > b.id)
delete a from table a
where exists(select 1 from table b where a.s/n = b.s/n and a.old_sn = b.old_sn and a.new_sn = b.new_sn and a.scan_datetime = b.scan_datetime and a.id > b.id)
有沒有什麼辦法不改變表的結構來實現謝謝