473,466 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

removing duplicate rows from access table


Hi,

How do you suggest is the best way to check for duplicate rows in an
access table. And once one knows if there are duplicates, to remove all
but one.

In my access table, there are 5 field columns. The first 4 columns are
descriptor fields. The 5th column is a value.

You know there are duplicate rows when the contents of the first four
columns are exactly the same in more than one of the rows of the table.

Thanks, and looking forward to your suggestions.

Dan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
3 4571
On 14 Oct 2004 22:28:44 GMT, dan graziano <d3********@hotmail.com>
wrote:

All but one? Which one?
You could do something like:
select Descriptor1, D2, D3, D4, Max(ValueField) from MyTable
Group by Descriptor1, D2, D3, D4

-Tom.


Hi,

How do you suggest is the best way to check for duplicate rows in an
access table. And once one knows if there are duplicates, to remove all
but one.

In my access table, there are 5 field columns. The first 4 columns are
descriptor fields. The 5th column is a value.

You know there are duplicate rows when the contents of the first four
columns are exactly the same in more than one of the rows of the table.

Thanks, and looking forward to your suggestions.

Dan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #2

Tom,

Thanks for the suggestion. They should all be the same, so it shouldn't
matter which one or ones are deleted as long as there is one remaining.
How would you complete the code if that was the situation? Thanks.

Dan
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
On 15 Oct 2004 12:58:37 GMT, dan graziano <d3********@hotmail.com>
wrote:

You could turn my suggested SQL Statement into a MakeTable query,
which would create a new table. If you're happy with the data, you can
delete the original table.

-Tom.


Tom,

Thanks for the suggestion. They should all be the same, so it shouldn't
matter which one or ones are deleted as long as there is one remaining.
How would you complete the code if that was the situation? Thanks.

Dan
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Iain | last post by:
Hi I have inherited a web app with the following table structure, and need to produce a table without any duplicates. Email seems like the best unique identifier - so only one of each e-mail...
0
by: amber | last post by:
Can someone tell me what I may be doing wrong here... I'm trying to remove rows from a table in a dataset that have the same data. My code is pasted below. The 2nd time it runs through the code,...
4
by: Drew | last post by:
I have a permission tracking app that I am working on, and I have made the insert page for it. I am having issues on how to prevent duplicates from getting entered. Currently the interface for...
6
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
7
by: Jon Maz | last post by:
Hi, I have a MySql problem I hope someone can help me with. I'm trying to run an update on a linking table, the update is running into a Primary Key constraint violation, and in my workaround...
10
by: Backwards | last post by:
Hello all, I'll start by explaining what my app does so not to confuss you when i ask my question. ☺ I have a VB.Net 2.0 app that starts a process (process.start ...) and passes a prameter...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
2
by: nano | last post by:
Does sql server have a way to handle errors in a sproc which would allow one to insert rows, ignoring rows which would create a duplicate key violation? I know if one loops one can handle the error...
5
jamesd0142
by: jamesd0142 | last post by:
My manager and I where looking at some complex code to eliminate duplicate records in a database table. then it hit me how its done easily... so i thought i'd share it... In English:...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.