create proc ItemDel
as
begin
delete t from pps_itemtable t where exists(
select 1 from pps_itemtable where itemno=t.itemno and itemname=t.itemname and itemspec=t.itemspec
and subitemno=t.subitemno and subitemname=t.subitemname and subitemspec=t.subitemspec
and level1=t.level1 and level2=t.level2
and id>t.id)
end
as
begin
delete t from pps_itemtable t where exists(
select 1 from pps_itemtable where itemno=t.itemno and itemname=t.itemname and itemspec=t.itemspec
and subitemno=t.subitemno and subitemname=t.subitemname and subitemspec=t.subitemspec
and level1=t.level1 and level2=t.level2
and id>t.id)
end