我正在尝试列出所有发布商在数据库上有一本书。
查询:
SELECT Publisher
FROM book
GROUP BY Publisher
HAVING COUNT(book) = 1;
答案 0 :(得分:2)
我的猜测是问题在这里......
HAVING COUNT(book) = 1
该表名为book
。除非该表还包含名为book
的字段,否则Access将会混淆。
如果您想查看只有一行的Publisher
,请使用此...
SELECT Publisher
FROM book
GROUP BY Publisher
HAVING COUNT(*) = 1;