Advertisement
Maks140888

Untitled

Jun 1st, 2022
1,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.39 KB | None | 0 0
  1. create or REPLACE function find_parent_object (obj_x VARCHAR2)
  2. return varchar2 as parent_obj varchar2(200);
  3. begin
  4.     select  name
  5.     into parent_obj
  6.     from objects
  7.     where level = 2 START WITH objects.name = obj_x  
  8.     CONNECT by prior objects.parent_id = object_id;
  9.    
  10.     return parent_obj;
  11. end;
  12.  
  13. select find_parent_object(name) from objects where name = 'Томас Шелби'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement