I have an emp table with the records below:
emp
INSERT into emp(EmpId,Emp name, Manager) Values(1,A,M1) values(2,B,M1) values(3,C,M2) values(4,D,M3)
If you are using Oracle Database, you can simply use stats_mode function this will return single value with highest occurrences.
select stats_mode(manager) from emp;
This is very easy to use function instead of writing multiple lines of sql query.