--创建需要删除重复数据的视图
CREATE VIEW M_Tabs_GoodsStuff_view_Del AS
SELECT
ROW_NUMBER() OVER (PARTITION BY GoodsID,ColorID ORDER BY (SELECT 1) ) AS no,
GoodsID,ColorID
FROM M_Tabs_GoodsStuff
--删除多余的数据
DELETE FROM M_Tabs_GoodsStuff_view_Del WHERE no != 1
--创建需要删除重复数据的视图
CREATE VIEW M_Tabs_GoodsStuff_view_Del AS
SELECT
ROW_NUMBER() OVER (PARTITION BY GoodsID,ColorID ORDER BY (SELECT 1) ) AS no,
GoodsID,ColorID
FROM M_Tabs_GoodsStuff
--删除多余的数据
DELETE FROM M_Tabs_GoodsStuff_view_Del WHERE no != 1