I need to write a query to find the actor having max earnings per movie in Neo4j db.
I have written below query:
match (a:Person)-[role:ACTED_IN]->(m:Movie)
return m.title as Movie, max(role.earnings) as earnings
This gives me the max earning in a movie.
How to find the actor corresponding to that max earning?