Hi friends, I have a table ancestor, which has locations in a parent-child hierarchy. eg; abc1-0001,abc1-0001-ab,abc1-0001-ab-01 etc, where abc1-0001 is parent for abc1-0001-ab, and it is parent for abc1-0001-ab-01 and so on... I have written the below query to fetch the levels. SELECT ancestor,lcation,connect_by_iscycle "cycle", LEVEL as abc,SYS_CONNECT_BY_PATH(ancestor, '//') "path" FROM max.ancestor CONNECT BY nocycle PRIOR ancestor = lcation. I want query to find the parent with highest number of levels(child) and count of levels for each parent. Please help.