473,698 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding duplicates

I have 100 tabes in an Access database, every table has 1 filed with
100 names (records), no primary key assigned. I would like to find
duplicates.

Here is the criteria:

The computer should pick up the first name of Table1 and check that
name in that table (Table1) as well as the remaining 99 tables.
Continue this till we reach the last name (record) of the 100th table.

Display the result in another table/query.
What is the best way to accomplish this task and how to do it.

Maxi

Nov 13 '05 #1
6 2889
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You could use a UNION ALL query as the source for the "find duplicates"
query. E.g.:

JET SQL:

SELECT [name]
FROM [
SELECT [name]
FROM table1

UNION ALL

SELECT [name]
FROM table2

UNION ALL

SELECT [name]
FROM table3

UNION ALL
Nov 13 '05 #2
Thanx Foster

I tried that and it worked. But this was just an example that I gave
you.

Actually, I have 61 tables and every every table has 352716 records.

But when I try to find duplicates with the help of your SQL statement,
it gives an error half way "No space on temporary disk"

I have 3 partitions with more than 3 GB space available on every
partition.
I have used the SET TEMP=C:\WINDOWS \TEMP in my autoexec.bat file.
I have played with the virutal memory settings as well.
Cleared all my temporary files and .tmp files.
Tried everything given in this URL
http://support.microsoft.com/?kbid=161329
I have tried compacting/Analyze database to crunch the size but it does
not work.

Any ideas???

BTW what is "JET SQL:"? You started your SQL statement with that. Is
that a syntax?

Maxi

Nov 13 '05 #3
Somebody told me to make .mde file so that the size reduces and you
will be able to perform the above task.

When I tried to do that, "Make MDE" option is grayed out???
I am using ACCESS 2002

Please help

Maxi

Nov 13 '05 #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

JET SQL means the SQL statement that followed was in the SQL syntax that
the Access database engine follows, close to SQL-92 (JET = Joint Engine
Technology).

The UNION query creates a temporary table of all the data in each of the
UNION statements, therefore, you will have a table of approx. 21,515,676
rows. If you multiply that times the size of your column you get the
approximate number of bytes of space you're union statement will need to
just hold that data. The main query's GROUP BY also builds a temporary
table of approximately the same size, but slightly smaller. So you've
got a need for A LOT of disk space, plus A LOT of RAM.

You could probably run a sequential process on the tables. You could
run a merge sort on the data (instead of data in tables, data would be
in text files), then sequentially scan the final sorted file "looking"
for duplicates - they'd be items w/ the same spelling, in sequential
order. Once that process was complete you could create a table for all
the data, put a Primary Key (PK) on the column(s) that define a row's
uniqueness & put the data back in that table. The PK would prevent any
future duplicates.

I used to have some code that did merge sorts, but I think it was in the
FORTH language & I'm not sure where that code is now-a-days. You can
probably find some on the Web. Search for '"merge sort" VB' on Google
or Clusty, or your favorite search-engine site (remove the single quotes
when typing the search string into the search text box).

=====

Making an .mde file has nothing to do w/ your problem, which is lack of
RAM and disk space.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQfFxbIechKq OuFEgEQKAAgCcDp 2+XZjs+lspApQ/NtqW/JdbeCwAn0Dv
eSN/7oOh25ZMLOm/i8HLdTvV
=62ox
-----END PGP SIGNATURE-----
Maxi wrote:
Thanx Foster

I tried that and it worked. But this was just an example that I gave
you.

Actually, I have 61 tables and every every table has 352716 records.

But when I try to find duplicates with the help of your SQL statement,
it gives an error half way "No space on temporary disk"

I have 3 partitions with more than 3 GB space available on every
partition.
I have used the SET TEMP=C:\WINDOWS \TEMP in my autoexec.bat file.
I have played with the virutal memory settings as well.
Cleared all my temporary files and .tmp files.
Tried everything given in this URL
http://support.microsoft.com/?kbid=161329
I have tried compacting/Analyze database to crunch the size but it does
not work.

Any ideas???

BTW what is "JET SQL:"? You started your SQL statement with that. Is
that a syntax?

Maxi

Nov 13 '05 #5
An Access mdb needs to be in Access 2002 format to make it an MDE file in
Access 2002.

Perhaps you originally saved it in Access 2000 format?

Don't forget to save a backup before you make it an MDE.
Darryl Kerkeslager

"Maxi" <ma********@hot mail.com> wrote
Somebody told me to make .mde file so that the size reduces and you
will be able to perform the above task.

When I tried to do that, "Make MDE" option is grayed out???
I am using ACCESS 2002

Please help

Maxi

Nov 13 '05 #6
Maxi wrote:
I have 100 tabes in an Access database, every table has 1 filed with
100 names (records), no primary key assigned. I would like to find
duplicates.

Here is the criteria:

The computer should pick up the first name of Table1 and check that
name in that table (Table1) as well as the remaining 99 tables.
Continue this till we reach the last name (record) of the 100th table.

Display the result in another table/query.
What is the best way to accomplish this task and how to do it.

Maxi

I multiplied the following:
? 352716.0 * 40.0 * 61.0
860,627,040

Since a record may exist in table 1 and 2, and another in table 3 and 4
but not in 1, you'd need to scan all records.

You can see that if the name field is 40 chars, you have 850 meg+ in
bytes. The max size of a database mdb in A97 is 1 gig, so you are
slightly under it.

You might want to try creating a new MDB with a table in it that would
hold the names. You might even want to have an integer field to hold
the table name number...1 to 61. Then link that table to your
database. Then run a routine to append all names into that new table.
Air code:

Sub BuildTable
'assumes the tablenames as Table1 to Table61
Dim intFor As Integer
Dim strSQL As String
Dim strTable As String
For intFor = 1 to 61
strTable = "Table" & intFor
strSQL = "INSERT INTO HoldingTable " & _
"( NameField, TableNum ) " & _
"SELECT NameField, " & _
intFor & " As TNum FROM " & strTable & ";"
Currentdb.Execu te strSQL
Next
msgbox "Done"
End Sub

This will append all of the records from all 61 tables

I doubt you can create an index on the name field in Holding table since
having one that may then exceed the mdb size limit.

Once all of the names are appended to table HoldingTable you could try
to run a query.
Select NameField, Count(NameField ) As NameCount _
From HoldingTable _
Group By NameField _
Having Count(NameField ) > 1

It may take awhile to execute since you don't have an index on the
NameField but you should get the answers. By having the table number
also, you can later determine which table the duplicates came from.

To do that, you may want to create a table that has the table names and
the numbers 1...61. You could use this table for determining the table
number, in the above For/Next loop. Because if you had a duplicate on
the name Smith, you'd certainly like to know which tables Smith exists in.
Nov 13 '05 #7

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

Similar topics

3
4207
by: Erich | last post by:
I have a company table and I would like to write a query that will return to me any duplicate companies. However, it is a little more complicated then just matching on exact company names. I would like it to give me duplicates where x number of letters at the beginning of the company name match AND x number of letters of the address match AND x number of letters of the city match. I will be doing this in batches based on the first letter of...
0
1483
by: Timo Nentwig | last post by:
Hi! <node> <name>foo</name> <id>1</id> <age>7</age> </node> <node.....> <node> <name>foo</name>
6
2398
by: Marlene | last post by:
Hi All I have the following scenario, where I have found all the duplicates in a table, based on an order number and a part number (item).I might have something like this: Order PODate Rec Qty Invoice# Item Supplier Status POReceivedDate 570133 03/09/2004 50 0 DMEDIUM L0010 PENDING 03/09/2004 570133 03/09/2004 50 0 DMEDIUM L0010 PENDING 03/09/2004 570133 03/09/2004 50 0 DMEDIUM L0010 PENDING 03/09/2004
11
33525
by: paradox | last post by:
Basically I have an ArrayList of strings; I need a fast way of searching through and comparing the elements of the ArrayList and the return an ArrayList of items that have 3 Duplicates. For example, if the ArrayList has the following elements: elems = "blue" elems = "red" elems = "blue" elems = "green"
2
360
by: RICHARD BROMBERG | last post by:
I have two tables of Names and addresses, CustFile1 and CustFile2. There may be duplicate records in either or both of the files and some of the records in CustFile1 may match records in CustFile2. I want to combine the two files and create a file with no dupliate records. Could anyone suggest a technique? Signed,
22
6908
by: Simon Forman | last post by:
Is there a more efficient way to do this? def f(L): '''Return a set of the items that occur more than once in L.''' L = list(L) for item in set(L): L.remove(item) return set(L)
5
8279
by: limperger | last post by:
Hello everyone! Is out there any way to search for duplicate entries without using the "Find duplicates" option? In the Access 97 installed in my workplace, the Find duplicates option is disabled (don't ask me why) and I think that there are little chances of having it installed. Any wonder of how to overcome this situation without the aforementioned wizard? Thank you very much in advance Best regards from Barcelona
17
2996
by: Gayatree | last post by:
I have to concatenate 2 colimns in a table and find duplicates in them. I already used the method select * from tableA a where (select count(*) from TableA b where acol1+ +col2 = b.col1+ +col2)>1 But the performance is very bad. Data is also huge Can you help me Thanks in advance
3
25072
Thekid
by: Thekid | last post by:
I'm trying to figure out a way to find if there are duplicates in an array. My idea was to take the array as 'a' and make a second array as 'b' and remove the duplicates from 'b' using 'set' and then compare a to b. If they're different then it will print out 'duplicates found'. The problem is that even after trying different arrays, some with duplicates some without, that 'b' rearranges the numbers. Here's an example: a='1934, 2311,...
0
8672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7712
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3038
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 we have to send another system
2
2323
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.