Create Table From a Having Count Select
Hello Folks, any ideas here, I need to create a table using the below 'Select' as the criteria.
I have the following table and its has duplicate records, identified by double Unique_seq. I want to create a table of these else where, then delete them from schema.tablename.
Schmea.tablename
-------------------------
field1
field2
field3
field4
Unique_Seq
SELECT Unique_Seq,COUNT(Unique_Seq)
FROM Schema.Tablename
GROUP BY Unique_Seq
HAVING ( COUNT(Unique_Seq) > 1
I want to create the table using all the fields from schema.tablename
Thanks