Skip to content

Instantly share code, notes, and snippets.

@davutg
Created March 15, 2018 14:03
Show Gist options
  • Save davutg/1a9675d904b415eb487595b238451538 to your computer and use it in GitHub Desktop.
Save davutg/1a9675d904b415eb487595b238451538 to your computer and use it in GitHub Desktop.
Hierarchical query with Connect by
SELECT *
FROM tree t, item m
WHERE M.ID = RT.PARENTID
CONNECT BY PRIOR t.parentid = t.childid
START WITH t.chilid = 123456789
ORDER BY T.PARENTID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment