This is my table:
id | fk_company ------------------- 1 | 2 2 | 2 3 | 2 4 | 4 5 | 4 6 | 11
Just use count(id)
SELECT id, COUNT(id) as total FROM `table` GROUP BY fk_company;