daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Nov 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.   LPAD(' ', (level - 1) * 2) || t.name AS "Name"
  3. FROM (
  4.     select NULL, c_id, par_id, name from category
  5.     union all
  6.     select g_id, NULL, cat_id, name from goods
  7.   ) t
  8. LEFT JOIN moves m ON m.goods_id=t.g_id
  9. CONNECT BY PRIOR t.cat_id=t.par_id
  10. START WITH t.par_id IS NULL
  11. ORDER SIBLINGS BY t.name;
RAW Paste Data
Top