I am using oracle sql. I have a request:
Query1
select t1.object_id object1, t2.object_id ...
from objects t1, objects t2, object_types t3 ...
where ...
It really works. Now I need to select the n-level parent for t1.object1.
Its my request for this:
Query2:
select object_id
from objects
where object_type_id in
(
and rownum = 1
connect by prior parent_id = object_id
start with object_id=
It also works if I write the t1.object_id value manually. The problem is that if I write a few numbers instead of query3, it will work about 100 times faster. IMO this is because the request is executed every time for each object.
Now I need to make one big request with good performance. How can i do this?
query2. , query3 . bulk collect , pl/sql. .
with types as (
select object_id
from objects
where object_type_id in
(types)
and rownum = 1
connect by prior parent_id = object_id
start with object_id=
- exeption.
?
query1? where where?