导航

2011年8月3日

摘要: declare @max integer,@id integerdeclare cur_rows cursor local for select id,count(*) from 表名 group by id having count(*) > 1open cur_rowsfetch cur_rows into @id,@maxwhile @@fetch_status=0beginselect @max = @max -1set rowcount @maxdelete from 表名 where id = @idfetch cur_rows into @id,@maxendclose c 阅读全文

posted @ 2011-08-03 09:19 yjss 阅读(132) 评论(0) 推荐(0) 编辑