日期:2014-05-18 浏览次数:20692 次
select * from tablename t where 主键字段= ( select max(主键字段) from tablename where ProductID=t.ProductID and GuiGe=t.GuiGe and XingHao=t.XingHao and SalePrice=t.SalePrice )
------解决方案--------------------
--方法一:
select distinct ProductID,GuiGe,XingHao,SalePrice into temp from tb
truncate table tb
insert into( ProductID,GuiGe,XingHao,SalePrice)
select ProductID,GuiGe,XingHao,SalePrice
from temp