A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Excluding duplicate records in query



 
 
Thread Tools Display Modes
  #1  
Old November 27th, 2006, 07:06 PM posted to microsoft.public.access.queries
Roman B.
external usenet poster
 
Posts: 10
Default Excluding duplicate records in query

I have a table with about 300,000 records. Many are duplicates. I'm trying to
create a make-table query to get only 1 copy of each record while ignoring
the duplicate records.
Does anyone know how I can do this?

For example I have one column in the table that has phone numbers, is there
a wayt o only get the first record that has the phone number while ignoring
all the other records that have the same phone number?
  #2  
Old November 27th, 2006, 07:25 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Excluding duplicate records in query

A fast way if all fields are duplicated is to do a totals query and Group By
all columns.

"Roman B." wrote:

I have a table with about 300,000 records. Many are duplicates. I'm trying to
create a make-table query to get only 1 copy of each record while ignoring
the duplicate records.
Does anyone know how I can do this?

For example I have one column in the table that has phone numbers, is there
a wayt o only get the first record that has the phone number while ignoring
all the other records that have the same phone number?

  #3  
Old November 27th, 2006, 09:13 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Excluding duplicate records in query

I think that would only eliminate duplicates where all the fields were
equal.

Perhaps,

Group By the phone number and use FIRST on all the other fields. That won't
necessarily get the first record that has the phone number, but it will get
on of the records.

Another method is to build the table structure and set a unique index on the
phone number. Then do an insert into the built table. You will get an
error saying that ## records could not be added due to conflict in the
index. However, the query will insert one record with each phone number.


"KARL DEWEY" wrote in message
...
A fast way if all fields are duplicated is to do a totals query and Group
By
all columns.

"Roman B." wrote:

I have a table with about 300,000 records. Many are duplicates. I'm
trying to
create a make-table query to get only 1 copy of each record while
ignoring
the duplicate records.
Does anyone know how I can do this?

For example I have one column in the table that has phone numbers, is
there
a wayt o only get the first record that has the phone number while
ignoring
all the other records that have the same phone number?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.