Hvis vi antager, at du har en normaliseret struktur, skal du blot:
SELECT a.author, count(*)
FROM books b
INNER JOIN author a ON a.author_id=b.author_id
GROUP BY a.author
Hvis vi antager, at du har en normaliseret struktur, skal du blot:
SELECT a.author, count(*)
FROM books b
INNER JOIN author a ON a.author_id=b.author_id
GROUP BY a.author