Guest User

Untitled

a guest
Nov 19th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  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;
Add Comment
Please, Sign In to add comment