tabela1
id author
1 autor1
2 autor2
3 autor3
4 autor1
tabela2
id author
1 autor2
2 autor1
3 autor3
4 autor2
i teraz chcę wyciągnąć dane ile rekordów jest przypisanych do danego autora (kolumna author)
Dla jednej tabeli zapytanie wyglada tak
SELECT author COUNT(*) AS ile FROM tabela GROUP BY author
ale nie wiem, jak zrobić to dla dwóch tabel. Próbówałem przez operacje UNION, ale wtedy nie mogłem pogrupować danych według autora.