Home >php教程 >php手册 >ms sql删除重复的记录

ms sql删除重复的记录

WBOY
WBOYOriginal
2016-06-13 10:05:09777browse

: 我在ms sql中建了一个表,可由于种种原因有些记录重复了
: 记录完全的一模一样。
: 现在我想把重复的都删掉,只保留重复记录中的第一条。
: 我在database好象看到有介绍oracle的,
select distinct * into #table_name from table_name
delete from table_name
select * into table_name from #table_name
drop table #table_name
与此相关的是“select into”选项,可以在数据库属性
对话框中,勾起来此项,或者在Query Analyzer中执行
execute sp_dboption 'db_name','select into','true'
开启。默认值是关闭的。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn