I need to make the return of this query the number of items per category and the number of items by subcategories also properly grouped,
For example:
Categoria Quantidade Subcategoria Quantidade
A 4 A1 2
B 5 B1 3
**