Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 7, 2019 16:28
Show Gist options
  • Save vladbatushkov/12810d59beb0d9300a8dfa333ba4fa0c to your computer and use it in GitHub Desktop.
Save vladbatushkov/12810d59beb0d9300a8dfa333ba4fa0c to your computer and use it in GitHub Desktop.
Top 3 of longest difference of 2 stations.
MATCH (w1:Wave)-[d:NEXT*2]->(w2:Wave)
WITH w1, w2, reduce(result = 0, x in d | result + x.diff) as diff
RETURN w1, w2, max(diff) as max_diff
ORDER BY max_diff DESC
LIMIT 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment