user776676
user776676

Reputation: 4385

How to select unique record in a Microsoft Access table?

I have an Access table that has a few records as follows (ID, color):

1 red
1 blue
2 blue
3 white
3 yellow
3 red

How do I create a query so that only record with ID 2 is returned? I don't want to select IDs 1 and 3 because they each have multiple records in this table. Thanks.

Upvotes: 0

Views: 174

Answers (1)

Omar MEBARKI
Omar MEBARKI

Reputation: 647

SELECT * 
FROM  tbl 
GROUP BY ID
HAVING COUNT(*) = 1

Upvotes: 3

Related Questions