How to display records with number of repetitions?

Guys, maybe the question is simple, but not clear. Tell me.
You need to withdraw a simple SELECT * FROM one field repetition number of values.
SELECT t1.`id`, t1.`id_company`, t1.`phone`, t1.`email`, COUNT(t2.`id`)
FROM `company` AS t1
JOIN `company` AS t2 ON t1.`id_company` = t2.`id_company`

But it is not working. Probably do not need.
March 12th 20 at 08:40
1 answer
March 12th 20 at 08:42
Solution
SELECT t1.`id`, t1.`id_company`, t1.`phone`, t1.`email`, COUNT(t2.`id`)
FROM `company` AS t1
JOIN `company` AS t2 ON t1.`id_company` = t2.`id_company`
GROUP BY t2.`id`;
Thank you, it works. - carey47 commented on March 12th 20 at 08:45

Find more questions by tags MySQL