I am trying and searching the way to get ALL last level children (leafs) from a node, in a hierchical query in Oracle 11g database.
I have 2 tables
You can simply use CONNECT_BY_ISLEAF.
SELECT n.id, n.val FROM NODES n LEFT JOIN RELATION r ON (n.id = r.id_child) WHERE CONNECT_BY_ISLEAF = 1 CONNECT BY PRIOR n.id = r.id_father START WITH r.id_father IS NULL