new method added to get the correlated sub query for the level of the nodes