Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- LPAD(' ', (level - 1) * 2) || t.name AS "Name"
- FROM (
- select NULL, c_id, par_id, name from category
- union all
- select g_id, NULL, cat_id, name from goods
- ) t
- LEFT JOIN moves m ON m.goods_id=t.g_id
- CONNECT BY PRIOR t.cat_id=t.par_id
- START WITH t.par_id IS NULL
- ORDER SIBLINGS BY t.name;
Add Comment
Please, Sign In to add comment