Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DELETE Duplicates Statement

Status
Not open for further replies.

DDTiff

MIS
May 29, 2002
48
US
Hello,

Can someone help me with the DELETE Duplicates Statement?

I have a table named Junction in MS Access DB which duplicates each record by 47 times. Is there a DELETE statement which allows me to reduce the records copy to just 1. Thank you for your help in advance.


DTiff
 
You can use UNION.
select all the non id/autonumber fields like so:
SELECT somefield, someotherfield ...
then UNION that select statement with exactly the same select statement like so:
SELECT somefield, someotherfield FROM Junction
UNION
SELECT somefield, someotherfield FROM Junction


I have tried:
INSERT INTO myNODoubleTable
SELECT somefield, someotherfield FROM Junction
UNION
SELECT somefield, someotherfield FROM Junction


But this doesn't seem to work
 
Post your question in forum701 - Microsoft: Access Queries and JET SQL. This is a MS SQL Server forum. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Thank you all for helping out. I just got back to work, so I will try out the code, and let you know. Once again, I appreciate your concern and help.

DTiff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top