select cat_id,count(cat_id) as quanti from tabella group by cat_id