Query tree structure from node including all children

Hi,

I have a simple graph with one type of node (unique ID per node) connected to each other via an outgoing parent relationship and an incoming child relationship... Now I'm trying to query so I get one parent node and all it's children and childrens children and so on distinct but doesn't succeed to get a good result...

Try something like this.

Match(n:Node{id:$id})
Match p=(n)-[:HAS_CHILD*]->(m)
Where not exists( (m)-[:HAS_CHILD]->() )
Unwind nodes(p) as node
Return distinct node