Need idea about Cypher query writing

link to related question