2010年2月8日
摘要: 方法一declare @max integer,@id integerdeclare cur_rows cursor local for select 主字段,count(*) from 表名 group by 主字段 having count(*) > 1open cur_rowsfetch cur_rows into @id,@maxwhile @@fetch_status=0begin... 阅读全文
posted @ 2010-02-08 15:49 dongpo 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 由于种种原因,在数据库中出现了我们不希望出现的重复数据,当对这些重复的数据进行删除的时候有许多种方法。我发现在网上流行的一种方法是利用临时表的方法,SQL脚本如下: select distinct * into #Tmp from tableName drop table tableName select * into tableName from #Tmp drop table #Tmp  该方... 阅读全文
posted @ 2010-02-08 15:45 dongpo 阅读(271) 评论(0) 推荐(0) 编辑