If I have a single field, say, project_id where I want to count the occurrences, I would do something like:
select project_id, count(project_id) as count fro
select project_id, service_id, count(*) as count
from tbl group by project_id, service_id
order by count(*) desc
Just add service_id
to your group by
and select
list. That should do it.
EDIT -
As per comment from @Rajah
it seems that for your expected output, you need to use
order by project_id asc, service_id asc