日期:2014-05-17 浏览次数:20740 次
-- try update yourTable set qty = 0 where id in (select id from (select t.*, row_number() over(partition by name, qty order by id) rn from yourTable t) where rn <> 1)
------解决方案--------------------
-- TRY IT .. UPDATE TT T1 SET QTY = 0 WHERE EXISTS (SELECT 1 FROM TT T2 WHERE T1.NAME = T2.NAME AND T1.ID > T2.ID);