select r.*,max(connect_by_root(c_name)) as root , max(level)
from relat r
where connect_by_isleaf = 1
start with chld = 'srv'
connect by prior p_name = c_name
group by r.par, r.chld, r.c_name, r.p_name;
I want to include CONNECT_BY_ROOT(c_name) into GROUP BY clause instead of using MAX() function on it. If I add CONNECT_BY_ROOT(c_name) into GROUP BY clause it throws me error not a group by expression. So is there any way to do it?