On MS access, ways to get the "ID" from the records getting duplicate content around the "myData" column ?

something similar to :

----------------------             ------------------------         
  ID   |   myData    |             |   ID   |   myData    |   
----------------------             ------------------------
   1   |   AAA       |             |    1   |   AAA       |
----------------------             ------------------------
   2   |   BBB       |             |    5   |   AAA       |
----------------------    ==>      ------------------------
   3   |   CCC       |             |    2   |   BBB       |
----------------------             ------------------------
   4   |   BBB       |             |    4   |   BBB       |
----------------------             ------------------------
   5   |   AAA       |
----------------------             

All I'm able to do to date do is query:

SELECT        myData, COUNT(myData) AS Expr1
FROM            fooDB
GROUP BY myData
HAVING        (COUNT(myData) > 1)

which only returns a listing from the replicates records from "mydata" and the amount of occurrences, adding other things will fail at execute. (with no ID's)

OR

Saying I being able to access the DB like a DataTable in C#, how you can manage this? Particularly when this table has ~2000 records.

( maybe outside assistance regarding how to use INTERSECT to allow it return the entire rows getting replicates on a single column )

Thanks.

SELECT ID, fooDB.myData
FROM (
  SELECT myData
  FROM fooDB
  GROUP BY myData
  HAVING COUNT(myData) > 1
) t INNER JOIN fooDB ON (t.myData = fooDB.myData)

I'm not sure if you're able to perform a subquery in Access such as this, but here is a typical SQL method of doing it:

SELECT
    id,
    my_data
FROM
    My_Table
WHERE
    my_data IN
    (
        SELECT
            my_data
        FROM
            My_Table
        GROUP BY
            my_data
        HAVING
            COUNT(*) > 1
    )

Just tossing this available...

SELECT distinct
    f.ID,
    f.myData
FROM 
    fooDB f
    inner join fooDB f2 on f.myData = f2.myData
        and f.ID <> f2.ID

Try

SELECT ID
  FROM fooDB
  WHERE myData IN (SELECT myData
                     FROM (SELECT myData, COUNT(myData) AS ROW_COUNT
                             FROM fooDB
                             GROUP BY myData)
                     WHERE ROW_COUNT > 1)

Share and revel in.