Mssql deletes duplicate records. : I created a table in mssql, but some records are repeated for various reasons: the records are exactly the same. : Now I want to delete all the duplicates and only keep the first record. : I created a table in ms SQL, but some records are repeated for various reasons.
: The records are exactly the same.
: Now I want to delete all the duplicates and only keep the first record.
: I see oracle introduction 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
This is related to the "select into" option, which can be in the database attribute
In the dialog box, check this item, or execute it in Query Analyzer.
Execute sp_dboption 'DB _ name', 'Select into', 'True'
Enable. The default value is disabled.
Explain I created a table in ms SQL, but some records are repeated for various reasons: the records are exactly the same. : Now I want to delete all duplicates and only keep the first record in the record ....