欢迎来到福编程网,本站提供各种互联网专业知识!

一条DELETE语句

发布时间:2009-02-12 作者: 来源:转载
原来DELETE语句有deletefrom***from***的格式
WITH w AS(
SELECT Id,ROW_NUMBER() OVER(ORDER BY Id DESC) AS [Row]
FROM [t1]
WHERE Code=@Code
)
DELETE FROM t1 FROM t1 s INNER JOIN w ON s.Id=w.Id
WHERE w.Row>100;

相关推荐