Home >Backend Development >PHP Tutorial >ms sql delete duplicate records_PHP tutorial
: 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.