Home >Backend Development >PHP Tutorial >ms sql delete duplicate records_PHP tutorial

ms sql delete duplicate records_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:01:25925browse

: I created a table in MS SQL, but due to various reasons some records are duplicated
: The records are exactly the same.
: Now I want to delete all duplicates and keep only the first duplicate record.
: I seem to have seen an introduction to Oracle in the database,
select distinct * into #table_name from table_name
delete from table_name
select * into table_name from #table_name
drop table #table_name
Related to this is the "select into" option, which can be checked in the database properties
dialog box, or executed in Query Analyzer
execute sp_dboption 'db_name','select into', 'true'
enabled. The default value is off.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631163.htmlTechArticle: I created a table in ms sql, but some records are duplicated due to various reasons: the records are exactly the same . : Now I want to delete all duplicates and keep only the first duplicate record. ...
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