1

我正在尝试在数据库中列出所有拥有一本书的出版商。

询问:

SELECT Publisher
FROM book
GROUP BY Publisher
HAVING COUNT(book) = 1;
4

1 回答 1

2

我的猜测是问题在这里......

HAVING COUNT(book) = 1

该表名为book。除非该表还包含一个名为 的字段book,否则 Access 将被混淆。

如果您想查看Publisher哪些只有一行,请使用此...

SELECT Publisher
FROM book
GROUP BY Publisher
HAVING COUNT(*) = 1;
于 2013-10-24T16:43:38.450 回答