Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --1.
- select LEVEL, lpad(' ',2*(level-1)) ||categoryname
- from categories
- start with othercatid is null
- connect by prior categoryid = othercatid ;
- --2.
- select LEVEL, lpad(' ',2*(level-1)) ||c.categoryname
- from
- (SELECT c.categoryid, upper(c.categoryname) categoryname, c.othercatid
- FROM categories c
- UNION
- select p.productid *1000, lower(p.productname) productname, p.categoryid
- from products p,categories c
- WHERE p.productid = c.categoryid) c
- start with othercatid is null
- connect by prior c.categoryid = c.othercatid ;
- --de pus in view
Add Comment
Please, Sign In to add comment