摘要:
方法一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... 阅读全文
摘要:
由于种种原因,在数据库中出现了我们不希望出现的重复数据,当对这些重复的数据进行删除的时候有许多种方法。我发现在网上流行的一种方法是利用临时表的方法,SQL脚本如下: select distinct * into #Tmp from tableName drop table tableName select * into tableName from #Tmp drop table #Tmp 该方... 阅读全文
![](/skins/gray/images/separator.gif)