删除重复文件sql

来源:互联网 发布:云计算架构师学不成 编辑:程序博客网 时间:2024/05/07 05:41

declare @max integer,@id integer
declare cur_rows cursor local for select userid,count(*)
from L_BinNew_bk where date_date='2010-01-20' and localIP='192.168.0.11' group by userid having count(*) > 1 open cur_rows
fetch cur_rows into @id,@max
while @@fetch_status=0
begin select @max = @max -1 set rowcount @max delete from L_BinNew_bk
where userid = @id fetch cur_rows into @id,@max
end close cur_rows
set rowcount 0

原创粉丝点击