SQL SELECT DISTINCT Statement

How do I write a Select Distinct statement that delete duplicate data from a table and dump the result to another table?
yguyon28Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you can do both in 1 statement with sql 2005+:
using the DELETE ... OUTPUT ... INTO @table   followed by INSERT INTO othertable ... SELECT ... FROM @table
see here:
http://msdn.microsoft.com/en-us/library/ms177564.aspx
0
 
yguyon28Author Commented:
Oh ok, can you write me a basic SQL statement that does this.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please see example F on the linked page
0
 
wdosanjosCommented:
@yguyon28:

Do all columns in your table indicate a duplicate record?  Or just a few columns?
0
 
wdosanjosCommented:
Also, does your table have a primary key?
0
All Courses

From novice to tech pro — start learning today.