delete duplicate

G

Guest

I have a table called table1 with two field
Field1 called user_name
Field2 called machine_name

I want to delete any duplication
so if my table is
user_name machine_name
aa 1
aa 2
bb 1
bb 1
bb 1
cc 1
cc 2
cc 1
cc 2
cc 3

I want to be left with
user_name machine_name
aa 1
aa 2
bb 1
cc 1
cc 2


Can you help thanks
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't have enough info in the table to delete duplicates using a
query. My solution would be to create a new table with the same columns
& with a primay key on the 2 columns & then use VBA to read the 1st
table and insert the rows into the 2nd table. When a duplicate error
occurs skip the current row & move on to the next row. After the 2nd
table is filled, delete the 1st table and rename the 2nd table w/ the
1st table's name.

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

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

iQA/AwUBQcMwaoechKqOuFEgEQIXDACgle9+NBVy9a84awgHBHbKAe8VIO4AoPQC
5b8o2M/UZxkyst67wy+B9uXo
=ng4Q
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top