欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

一条DELETE语句

程序员文章站 2022-11-21 10:42:53
with w as( select id,row_number() over(order by id desc) as [row] from [t1] where code...
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;