In MS-access, how to get the "identifier" of records that have duplicate content in the "myData" column?
sort of:
---------------------- ------------------------
ID | myData | | ID | myData |
---------------------- ------------------------
1 | AAA | | 1 | AAA |
---------------------- ------------------------
2 | BBB | | 5 | AAA |
---------------------- ==> ------------------------
3 | CCC | | 2 | BBB |
---------------------- ------------------------
4 | BBB | | 4 | BBB |
---------------------- ------------------------
5 | AAA |
----------------------
All I can do so far is this request:
SELECT myData, COUNT(myData) AS Expr1
FROM fooDB
GROUP BY myData
HAVING (COUNT(myData) > 1)
which returns only a list of duplicate entries from "mydata" and the number of occurrences, adding something else is not performed at runtime. (and not ID)
OR
Saying that I am accessing the database as a DataTable in C #, how do I do this? Especially if this table has 2000 entries.
(maybe some help on how to work with INTERSECT so that it returns full rows having duplicates in the same column)
Thank.