Delete duplicate records

E

Ellen

Hello,
I have a table with some identical records. Can someone
tell me how to delete the duplicates? It is a table with
two fields, field1 and field2.

Thank you in advance,
Ellen
 
G

Gerald Stanley

Rather than deleting the duplicates, I would advise making
a new table with only the distinct rows e.g.

SELECT DISTINCT field1, field2 INTO {yourNewTable} FROM
{yourOriginalTable};

You will have to change the {yourNewTable} and
{yourOriginalTable} including {} to suit your application.
After the query has run, you can delete the original table
an rename the new table as the original.

Hope This Helps
Gerald Stanley MCSD
 
G

Guest

It definitely does help. Thanks, Gerald!
-----Original Message-----
Rather than deleting the duplicates, I would advise making
a new table with only the distinct rows e.g.

SELECT DISTINCT field1, field2 INTO {yourNewTable} FROM
{yourOriginalTable};

You will have to change the {yourNewTable} and
{yourOriginalTable} including {} to suit your application.
After the query has run, you can delete the original table
an rename the new table as the original.

Hope This Helps
Gerald Stanley MCSD
.
 
Top