尝试
SELECT *
FROM
(
SELECT book_publisher, COUNT(DISTINCT book_author_id) author_count
FROM table1
GROUP BY book_publisher
ORDER BY author_count DESC
)
WHERE rownum = 1
或者
WITH cte AS
(
SELECT book_publisher, COUNT(DISTINCT book_author_id) author_count
FROM table1
GROUP BY book_publisher
)
SELECT book_publisher
FROM cte
WHERE author_count =
(
SELECT MAX(author_count)
FROM cte
)
或具有分析功能
SELECT book_publisher, author_count
FROM
(
SELECT book_publisher,
COUNT(DISTINCT book_author_id) author_count,
DENSE_RANK() OVER (ORDER BY COUNT(DISTINCT book_author_id) DESC) rank
FROM table1
GROUP BY book_publisher
)
WHERE rank = 1
这是SQLFiddle演示