I am working with queries in MSAccess 2010.
I would like to find combinations of duplicates in multiple columns, count their frequency, give each count of resulting duplicates a unique ID, and group by one specific field. My table has over 90 fields and looks like this:
ID Field1 Field2 Field3
-----------------------------
12554 0 1 0
12558 1 0 0
15488 1 0 0
11457 0 1 0
11554 1 1 0
I would like it to look like this:
RecID Field1 Field2 Field3 FREQ FREQID
-------------------------------------------------
11457 0 1 0 2 DU0001
11554 1 1 0 1 DU0002
12554 0 1 0 2 DU0003
12558 1 0 0 2 DU0004
15488 1 0 0 2 DU0004
I have returned successful results using SELECT, count(*), GROUP, and HAVING as far as the count and grouping go, but am stumped by how to add/code for an ID field that returns autogen results, and how to have each row on the table show up with the original RecID
Here's what's working so far, and am still stumped:
SELECT Table1.Field1, Table1.Field2, Table1.Field3, Count(*) AS FREQ
FROM Table1
GROUP BY Table1.Field1, Table1.Field2, Table1.Field3
HAVING (Count(*) >= 1);
Because I'm new at this it would be ideal if it only involved a single query.