a guest Nov 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- 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;
RAW Paste Data