Title / Description
Code WITH RECURSIVE search_graph(parent_id, child_id, depth, path, cycle) AS ( select g.parent_id, g.child_id, 1, ARRAY[child_id, parent_id], // # <1> false from staffing.skill_mindmap g where g.child_id = 10006 UNION ALL select g.parent_id, g.child_id, sg.depth + 1, path || g.parent_id, g.parent_id = ANY(path) from staffing.skill_mindmap g, search_graph sg where sg.parent_id = g.child_id AND NOT cycle [ // <2> ) SELECT sg.parent_id, skp.desc_short, sg.child_id, skc.desc_short, sg.depth, sg.path, sg.cycle FROM search_graph AS sg INNER JOIN staffing.skill AS skp ON sg.parent_id = skp.id INNER JOIN staffing.skill AS skc ON sg.child_id = skc.id
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code