日期:2014-05-17 浏览次数:20533 次
DELETE dbo.GameActor FROM dbo.GameActor a WHERE EXISTS( SELECT 1 FROM dbo.GameActor WHERE (UserID=a.UserID AND ActorLevel>a.ActorLevel) OR (UserID=a.UserID AND ActorLevel=a.ActorLevel AND Experience>a.Experience) OR (UserID=a.UserID AND ActorLevel=a.ActorLevel AND Experience=a.Experience AND WriteTime>a.WriteTime) )
------解决方案--------------------
-->try DELETE dbo.GameActor FROM dbo.GameActor a WHERE ( SELECT COUNT(ActorLevel) FROM dbo.GameActor WHERE UserID=a.UserID AND ((ActorLevel>a.ActorLevel) or (ActorLevel=a.ActorLevel AND Experience>a.Experience)) --OR (UserID=a.UserID AND ActorLevel=a.ActorLevel AND Experience=a.Experience AND WriteTime>a.WriteTime) )>1