I need to find a manager with the maximum number of subordinates (USING CYPHER). I need to know his/her id and how many subordinates are under his/her management control.
I have created this query:
MATCH (b:UserNode)
MATCH (b)-[r:IS_MANAGER_FOR]->(subordinate)
RETURN b.user_id,
count(subordinate)
ORDER BY count(subordinate) DESC LIMIT 1
But something is wrong, could you help me with this, thank you in advance!
Comments
Post a Comment