advance connect by
in the below result.. my base group id is 1310..
set SERVEROUTPUT ON;
execute tp_tid_gid(31051);
[1310]
1267261807,1310
1537351026,1310
13102,1267261807
13104,1267261807
13108,1267261807
131016,1267261807
131022,1267261807
131032,1267261807
131044,1267261807
131064,1267261807
131088,1267261807
1310128,1267261807
13101616,1267261807
13103232,1267261807
13106464,1267261807
1310128128,1267261807
now I need result as below.. expected result.
1267261807,1310
1537351026,1310
13102,1310
13104,1310
13108,1310
131016,1310
131022,1310
131032,1310
131044,1310
131064,1310
131088,1310
1310128,1310
13101616,1310
13103232,1310
13106464,1310
1310128128,1310
code:
create or replace
PROCEDURE tp_tid_gid( p_tid IN NUMBER ) AS
BEGIN
FOR myrec1 IN ( SELECT t1.param_group_id pg
FROM test_parameter_group t1
WHERE t1.test_instance_id = p_tid
GROUP BY t1.param_group_id
ORDER BY 1
)
LOOP
DBMS_OUTPUT.NEW_LINE;
DBMS_OUTPUT.PUT_LINE( ' [' || myrec1.pg || ']' );
FOR myrec2 IN ( SELECT x.pg, x.ppg
FROM ( SELECT t2.param_group_id pg
, t2.parent_param_group_id ppg