I have this query to count the times documentador is repeated in each table
(select count(documentador) AS count, documentador from impo_expo GROUP BY documentador order by documentador) UNION ALL
(select count(documentador), documentador from prov_compr GROUP BY documentador order by documentador) UNION ALL
(select count(documentador), documentador from pedimento GROUP BY documentador order by documentador) UNION ALL
(select count(documentador), documentador from partidas GROUP BY documentador order by documentador) order by documentador asc
OUTPUT:
count documentador
2 Imelda
4 Imelda
2 Imelda
1 Imelda
2 Juan Enrique
1 Juan Enrique
1 Juan Enrique
1 Juan Enrique
2 Raul
How can i combine them to have something like this?
count documentador
9 Imelda
5 Juan Enrique
2 Raul