Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Access 表,其中包含如下几条记录(ID、颜色):
1 red 1 blue 2 blue 3 white 3 yellow 3 red
如何创建查询以便只返回 ID 为 2 的记录?我不想选择 ID 1 和 3,因为它们在此表中都有多个记录。谢谢。
SELECT * FROM tbl GROUP BY ID HAVING COUNT(*) = 1