Ibra
Ibra

Reputation: 7

How can I query a table to find duplicate Memo field entries?

How can I query a table to find duplicate Memo field entries in MS Access?

Also please note that I don't have a primary key in my table.

Upvotes: 0

Views: 359

Answers (2)

forpas
forpas

Reputation: 164089

If Name is the primary key column and MemoColumn is the column for which you want to find duplicates, you can use EXISTS:

SELECT t.* FROM tablename AS t
WHERE EXISTS (
  SELECT 1 FROM tablename AS tt
  WHERE t.Name <> tt.Name and t.MemoColumn = tt.MemoColumn  
)

Upvotes: 0

Lee Mac
Lee Mac

Reputation: 16015

Here is one possible method:

select t.MemoField
from YourTable t
group by t.MemoField
having count(*) > 1

To test for duplication across multiple fields, you might use:

select t.MemoField1, t.MemoField2, t.MemoField3
from YourTable t
group by t.MemoField, t.MemoField2, t.MemoField3
having count(*) > 1

Upvotes: 1

Related Questions