Parent child level Query

Hi All,
I have a requirement to pull parent child partynames from hz_parties,hz_relationships table
I need output like below:
Partyname, partynumber,immediateparent(partyname),globlapartyname..
could you please suggest me.I am new to EBS..
Thanks
Bhavana

Any Help please....
Edited by: user13689917 on Mar 9, 2011 2:32 PM
Edited by: user13689917 on Mar 9, 2011 2:33 PM

Similar Messages

  • Credit Management Parent - Child level

    Hi,
    My client has two company codes A and B which share customers. I have following customer hierarchy :
    Parent - 1 - Limit - 10000
    Child Payer - 2 - Limit 6000
    Child Payer - 3 - Limit 4000
    We want to control the credit limit at each Payer level but want to see consolidated exposure and receivables at Parent level also.
    Thanks,

    Hi
    you can check for the consolidated value in TCode FD32 when you create a hierarchy it will be created like a single customer you can give the number along with the credit control area to get the consolidated parent level credit management.
    regards
    Vignesh

  • Parent child relationship query

    Hi all,
    I am working on oracle 9i.
    i have a branch table which has a column branch_id, branch_name etc with a column branch_parent(contains branch_id).
    Branch_parent column identifies the parent of this particular branch.
    I want to query this table and want to find out branches that are not a parent branch to other branches.
    I am using following query:
    SELECT A.*
    FROM branch_tbl A
    WHERE not exists
    (SELECT branch_id
    FROM branch_tbl
    WHERE branch_parent = A.branch_id)
    Can anyone tell me if it is a right query i am using or not?
    Thanks

    Looks right to me. Are you having problems with it?
    John

  • Parent Child heirarchies in OBIEE11g

    Hello Experts
    I have got a requirement from the client that they need to have multiple version of Parent child heirarchies coming out from a particulat dimension. To elaborate furthet say suppose there is a dinemsion called Profit Center where we need to create Parent child heirarchy. This is good if only one heirarchy needs to be created out of it. But instead there are three heirarchies - One MAster and two Custom.
    There would changes in the various parent child level in the reporting that's why different version of heirarchies.
    Having said that , one more issue is every month the heirarchies will changes that means the child can move to different parent . Some new parent/ child could be added etc. SO every month the Master and two custom heirarchy need to be refreshed.
    So my question is :
    1. How to achieve three version of Parent Child heirarchies. I know how to create Parent child heriarchies but three differnt heirarchy version out of a single dimension is the issue.
    2. How to automatocally refresh these heirarchies every month.
    Any help /pointer would be of great help.
    Regds

    Hello All
    Can anyone put some light on this pls...

  • Help needed on Many to Many Parent Child Relationship (PL/SQL)

    Friends,
    Please help me.
    I have table where in two columns are having many to many parent child relation ship. It means child can have multiple parents.
    Table strucuture and sample records given below. Here 334059 is GRAND PARENT of all child records.
    PARENT     CHILD     LEVEL     Usage
    334059     380499     1     This Level has 2 childs
    334059     334730     1     
    334730     335629     2     This level too has 2 childs where in 380499 is child of 334730 & 334059 also.
    334730     380499     2     
    380499     380497     2     This level has 3 childs and 88888 is having further child.
    380499     334730     2     
    380499     88888     2     
    88888     99999     3     It has one child 99999 and has further child 10101.
    99999     10101     4     It has one child 10101 and has further child 11111.
    10101     11111     5     It has one child 11111 and has no further child. I.e leaf node.
    11111     0     6     leaf node
    What I want is records in same level above. I am using below code but its implementing only UPTO 2nd LEVEL given above.
    Further its not going i.e 3,4,5,6 level. Could you please help me?
    DECLARE
    CURSOR main_pc(p_child pc.child%type) IS
    SELECT CHILD
    FROM pc where parent = p_child;
    CURSOR main_dw(p_child dw_exrdbo.exr_parent_child.child_fund%type,
    p_level NUMBER) IS
    SELECT DISTINCT CHILD_FUND,LEVEL_NUMBER FROM dw_exrdbo.exr_parent_child
    where parent_fund = p_child
    and parent_fund <> child_fund
    and level_number = p_level;
    v_next_parent pc.child%type;
    v_level NUMBER := 1;
    v_grand_parent dw_exrdbo.exr_parent_child.parent_fund%type := 334059;
    v_parent dw_exrdbo.exr_parent_child.parent_fund%type;
    vDone BOOLEAN;
    v_xyz dw_exrdbo.exr_parent_child.parent_fund%type;
    v_cnt NUMBER := 0;
    BEGIN
    DELETE FROM dw_exrdbo.exr_parent_child;
    COMMIT;
    INSERT INTO dw_exrdbo.exr_parent_child
    SELECT PARENT, CHILD, 'INVONE', 12345, 'P',0,1
    FROM pc where parent = v_grand_parent
    AND NOT EXISTS (select 'x' from dw_exrdbo.exr_parent_child where parent_fund = v_grand_parent);
    COMMIT;
    FOR i IN (select distinct child FROM pc WHERE parent = v_grand_parent) --334059
    LOOP
    DBMS_OUTPUT.PUT_LINE('Next Parent is '||v_parent);
    FOR x IN main_pc(i.child)
    LOOP
    INSERT INTO dw_exrdbo.exr_parent_child
    (parent_fund, child_fund, source_application, valuation_date_sid, parent_child_flag, child_count, level_number)
    VALUES(i.child, X.CHILD, 'INVONE', 12345, 'C',0,1+1);
    COMMIT;
    END LOOP;
    END LOOP;
    END;
    Thanks in advance!!!
    Regards,
    Jigger

    Hi, Jigger,
    Sorry, I can't tell what you want.
    Whenever you have a question, please post CREATE TABLE and INSERT statements for your sample data, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.

  • Except function with parent child hierarchy using mdx query

    HI,
    I need to remove some items using mdx query in parent child hierarchy.
    I tried with below query,it is not removeing ,could you please help me.
    SELECT
    {[Measures].[Amount]} ON
    COLUMNS
     NonEmpty([Account].[Accounts].[Account Level 01],[Measures].[Amount])
    ON ROWS
    FROM (SELECT
    -Descendants({[Account].[Accounts].&[47]},,Leaves)
    } ON COLUMNS
    FROM [Adventure Works])
    indu

    Hi Indu,
    Why do you remove some itmes using
    Descendants function? Generally, we use FILTER function to achieve the requirement.
    WITH SET [CustomAccounts] AS
    FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name<>'Net Income')
    SELECT {[Measures].[Internet Sales Amount]} ON 0
    [CustomAccounts] ON 1
    FROM [Adventure Works]
    WITH SET [CustomAccounts] AS
    FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name='Net Income')
    SET [RemainingAccount] AS
    [Account].[Accounts].[Account Level 01]- [CustomAccounts]
    SELECT {[Measures].[Reseller Sales Amount]} ON 0
    [RemainingAccount] ON 1
    FROM [Adventure Works]
    Results.
    References.
    http://www.databasejournal.com/features/mssql/article.php/3306101/MDX-Essentials-Basic-Set-Functions-The-Filter-Function.htm
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c0149678-97f2-4066-903f-7f9e9ff09b56/filtering-out-dimension-members-with-mdx?forum=sqlanalysisservices
    Regards,
    Charlie Liao
    If you have any feedback on our support,
    please click here.
    Charlie Liao
    TechNet Community Support

  • Parent Child Hierarchy  (N Level Hierarchy ) in BI 4.0

    Hi ,
    We have following table structure . We are trying to create parent-child hierarchy and  implement drill on the same .
    We are using Oracle  database as RDBMS.
    e.g.
    Child Key    Parent Key
    1   
    2                 1
    3                 1
    4                 2
    5                 2
    6                 3
    7                 1
    8                 5
    Now based on this table structure , if we create hierarchy using parent key and child key ,  we should be able to drill from 1 to {2,3,7} directly.
    further when i click on 2 ,  we should get {4,5 }  as resulting rows. 
    At the same time drill-down should not work on the values which are not parent of anyone (i.e. Leaf Node). e.g. 4, 8, 7, 6.
    Can anyone please let me know how can i achieve the same result by building hierarchy or any work around ?
    Regards ,
    Jeevan Chaudhari

    Dear Gowtham  ,
    I am very well aware of the level based hierarchy available in BO .
    The issue that i have raised is all about the Parent Child Hierarchy which creates the recursive query.
    I.e Every Parent has a child and that child can be parent of some other . (See the original example for more illustration)

  • Property at child level to be identified at parent level

    We have child items "ingredients" listed w/ properties that are identified as allergen types. I am trying to be able to identify by parent item which of the parent items contain allergens that are identified at the child level. I could do a query at the child level to identify those that have the property boxes checked and then do a where used for each item but that would take a long time and it would be difficult.

    I will give you an example.
    BOM
    item number: 41586    Description: 16 oz bbq sauce
    F0165  BBQ Sauce    500lbs (this is the phantom item that has a BOM with the ingredients that may contain allergend defined at the propert level)
    333154 16 oz jar   500 ea
    333155  cap   500 ea
    The current query identifies the allergens from the ingredient level to the phantom item level (F0165). I need it to identify at the level 41586.
    The phantom Item example is:3
    BOM
    item number: F0165  BBQ Sauce
    333156    tomato sauce   300 lbs
    333157     Smoke flavor     1lb
    333158     onion    2lb
    I am hoping that I can get the query so I can run a report to identify all allergens for items we sell to provide to customer service. As well as if I create a Production Order for 41586 I would like it to print the allergen it contains on the production order.

  • Find parent/child relationships At More Than 2 Levels

    Hello,
    Does anyone have a solution to find parent/child relationship for data more than 2 levels deep?
    I have a solution when there's a simple parent-child relationship but not when there's a grandparent-parent-child relationship or deeper.
    Ex. I have a table company_parent_child that stores the relationship betwen a company and it's direct parent.
    create table TEMP_COMPANY_PARENT_CHILD
    PARENT_ID NUMBER(10),
    COMPANY_ID NUMBER(10)
    insert into TEMP_COMPANY_PARENT_CHILD values (1, 10);
    insert into TEMP_COMPANY_PARENT_CHILD values (1, 11);
    insert into TEMP_COMPANY_PARENT_CHILD values (1, 12);
    insert into TEMP_COMPANY_PARENT_CHILD values (2, 13);
    insert into TEMP_COMPANY_PARENT_CHILD values (10, 100);
    insert into TEMP_COMPANY_PARENT_CHILD values (10, 101);
    insert into TEMP_COMPANY_PARENT_CHILD values (10, 102);
    insert into TEMP_COMPANY_PARENT_CHILD values (11, 103);
    1->
    ___10->
    ______100,101,102,
    ___11->103
    Companies 100, 101 and 102 are under parent 10 and grandparent 1.
    I need to create such a view or another temp table so that when I pass the parent ID, I will pull all the children on all levels. In addition, and this is the tricky part, when I join this new temp table or view to another data table without any parameters, the data should not be duplicate, ie. each company ID should appear only once.
    create table TEMP_JOIN
    company_id number(10),
    order_id varchar2(10)
    insert into TEMP_JOIN values (100, 'a');
    insert into TEMP_JOIN values (101, 'b');
    insert into TEMP_JOIN values (102, 'c');
    insert into TEMP_JOIN values (103, 'd');
    insert into TEMP_JOIN values (10, 'e');
    insert into TEMP_JOIN values (11, 'f');
    insert into TEMP_JOIN values (12, 'e');
    insert into TEMP_JOIN values (13, 'f');
    Thanks.

    start by learning CONNECT BY/START WITH. once you've
    written a query to read the grandparent-parent-child
    relationship, then come back with more questionsYes. we did look heavily into connect by/start with, in fact along with "connect_by_iscycle","connect_by_isleaf","connect_by_root" as well.
    Our dilemma is that when a joint is made between those two tables mentioned above TEMP_COMPANY_PARENT_CHILD and TEMP_JOIN, we are not able to create a view that would contain distinct company_ids, each mapped to a unique order id.
    The problem is we cannot have this type of joint when there are "n" level relationship between companies (or company_id). Basically, I think we should have our unique order id mapped to a unique key. This unique key should be a specialized key that we can know at anytime the entire path of the ancestry which we can know by sys_connect_by_path(company_id,'/') path.
    How do we know which path to take. The best bet is to "connect_by_isleaf" and just have the distinct "deep" path which form the specialized unique key. If you need help on this let me know. (A hint, sort by LEVEL and then do a rank after partitioning by company id and then filter the records by rank = 1, try this one!!!)
    So, we will eventually have a joint (say Table X) like
    PATH ORDER_ID
    /1/10/100 a
    /1/10/101 b
    /1/10/102 c
    /1/10 e
    /1
    /1/11/103 d
    /1/11 f
    I think this is the best view we can have to maintain a joint with no repetition along PATH as well as ORDER_ID. If you have any other thoughts, let me know.
    Then you query by path using INSTR to pull records by company_id.
    for example, if you want to get all the children for company_id "10" you would just say
    select * from X where INSTR(PATH,10,1,1) <> 0
    or if you want to get all the children for company_id "11" you would just say
    select * from X where INSTR(PATH,11,1,1) <> 0
    What do you think? Has anyone used the path information for traversing the tree? Or is there any article that tells us how to make effective use of sys_connect_by_path(company_id,'/') path.
    Thank you. Hope it made sense!

  • Querying parent child sets

    Hi
    I have a cube with a dimension that has a value based hierarchy (id, description,parent)
    Is it possible to query the cube to get parent child sets ?
    I want the result set to look like
    Member Value Parent
    Parent_1 Measure_Value NULL
    Child_1.1 Measure_Value Parent_1
    Child_1.2 Measure_Value Parent_1
    Parent_2 Measure_Value NULL
    Child_2.1 Measure_Value Parent_2
    Child_2.2 Measure_Value Parent_2
    Also I am using a java front end,so I would like to do some pagination
    So I would like say 1st 50 sets , 2nd 50 sets and so on

    Cube Materialized Views are only created if you enable them and they are also only compatible with level based hierarchies. So MVs are not appropriate in your case.
    If you are generating your own SQL then you could consider a hybrid approach by combining OLAP DML and SQL to get the explicit list of members. First execute the following OLAP DML.
    LIMIT my_dim TO 'Parent_1' 'Parent_2'
    LIMIT my_dim ADD DESCENDANTS USING my_dim_parentrel
    SORT my_dim HIERARCHY my_dim_parentrelNow get the dimension members via either OLAP DML (e.g. REPORT command) or running SQL after the limit above. This gives you the explicit list of members that you can feed into a subsequent query.
    SELECT dim_key, ...
    FROM my_dim_view, cube_view
    WHERE
      <join condition>
      AND dim_key IN (...list from report command...}
      Make sure you set status back via ALLSTAT after getting the list or it will change results later.

  • Query Help with Parent, Child, Child's Child

    Hi all,
    Need some help with a query.  I'm trying to create a stored procedure that is sort of like a Customer, Order, Order, Details.  In my situation the tables are different but nevertheless, I want to grab all the fields from the  Parent, Child,
    and Childs' Child, where the Parent.ParentID = @Parameter.  I tried this:
    CREATE PROCEDURE [dbo].[spGetCompleteProjectXML]
    @ProjectID int = 0
    AS
    SELECT *,
    (SELECT *,
    (SELECT *
    FROM PageControls
    WHERE (PageControls.ProjectPageID = ProjectPages.ProjectPageID))
    FROM ProjectPages
    WHERE (ProjectPages.ProjectID = @ProjectID))
    FROM Projects
    WHERE (ProjectID = @ProjectID)
    FOR XML AUTO, ELEMENTS
    RETURN 0
    I think I'm close, but it was my best effort.  Could someone help?
    thanks in advance

    Hi TPolo,
    Regarding your description, are you looking for a sample like below?
    CREATE TABLE customer(customerID INT, name VARCHAR(99))
    INSERT INTO customer VALUES(1,'Eric')
    INSERT INTO customer VALUES(2,'Nelson')
    CREATE TABLE orders(orderID INT,customerID INT)
    INSERT INTO orders VALUES(1,1);
    INSERT INTO orders VALUES(2,1)
    INSERT INTO orders VALUES(3,2)
    INSERT INTO orders VALUES(4,2)
    CREATE TABLE orderDetails(orderID INT,item VARCHAR(99))
    INSERT INTO orderDetails VALUES(1,'APPLE1')
    INSERT INTO orderDetails VALUES(1,'BANANA1')
    INSERT INTO orderDetails VALUES(2,'APPLE2')
    INSERT INTO orderDetails VALUES(2,'BANANA2')
    INSERT INTO orderDetails VALUES(3,'APPLE3')
    INSERT INTO orderDetails VALUES(3,'BANANA3')
    INSERT INTO orderDetails VALUES(4,'APPLE4')
    INSERT INTO orderDetails VALUES(4,'BANANA5')
    SELECT customer.customerID,customer.name,
    (SELECT orderId,
    SELECT item FROM orderDetails WHERE orderID=orders.orderID FOR XML AUTO,TYPE,ELEMENTS
    FROM orders Where customerID=customer.customerID FOR XML AUTO,TYPE,ELEMENTS)
    FROM customer WHERE customerID=1
    FOR XML AUTO,ELEMENTS
    DROP TABLE customer,orderDetails,orders
    If you have any feedback on our support, please click
    here.
    Eric Zhang
    TechNet Community Support

  • Parent child relation using query

    Hi,
    If i pass one parameter as a parent.It will
    retrieve all the child and subchild...
    but it will be retrieved by one single query.
    Is it possible?If possible pls give me an idea.
    I got the inner most child using stored procedure and recursive fn.
    But I couldnt get the child and subchild using
    single query....
    pls give an idea
    below i gave table for example
    Sno     Parent     Child
    1     MD     GM
    2     GM     Material manager
    3     GM     Production manager
    4     Production manager     Material staff
    5     Material staff     production staff
    6     production staff     Material student
    7     Material student     production student
    if i pass GM as a parent. it will retrieve
    material manager and production manager...but it will be worked in single query
    Thanks

    Hi,
    SELECT * FROM t11
    START WITH parent='GM'
    CONNECT BY PRIOR child=parent
    Out put :-
    2 GM Material manager
    3 GM Production manager
    4 Production manager Material staff
    5 Material staff production staff
    6 production staff Material student
    7 Material student production student
    Pavan Kumar N

  • Incorrect query forms in parent child relation

    Hello
    I am using jdev of RUP3 (Release 4) which is 11.1.1.6.2 and have following scenario
    I have a ParentVO (ProfileVO) and a child VO(CreditReceiversVO) (child VO is basically extended from another VO not in this application and included as a jar library).
    There a VL between ParentVO and ChildVO 1:* with two attributes ord_id and rule_id
    On UI these two VO instances are dropped as parent child and I get exception on running page in logs saying RuleAssignementEO.ORG_ID invalid identifier.
    Looking into the query formed by BC4J I see it as below which is clearly wrong as the alias RuleAssignmentEO is not visible for the outermost where clause. Please advise
    "SELECT count(1) FROM (SELECT * FROM (SELECT /*+ FIRST_ROWS(10) */
    RuleAssignmentsEO.RULE_ASSIGNMENT_ID,
    RuleAssignmentsEO.OBJECT_VERSION_NUMBER,
    RuleAssignmentsEO.RULE_ID,
    RuleAssignmentsEO.ASSIGNED_OBJECT_ID,
    RuleAssignmentsEO.ASSIGNED_OBJECT_TYPE,
    RuleAssignmentsEO.ORG_ID,
    RuleAssignmentsEO.ROLE_ID,
    RuleAssignmentsEO.START_DATE,
    RuleAssignmentsEO.END_DATE,
    RuleAssignmentsEO.SPLIT_PCT,
    RuleAssignmentsEO.REVENUE_TYPE,
    RuleAssignmentsEO.ROLLUP_FLAG,
    RuleAssignmentsEO.CREATED_BY,
    RuleAssignmentsEO.CREATION_DATE,
    RuleAssignmentsEO.LAST_UPDATED_BY,
    RuleAssignmentsEO.LAST_UPDATE_DATE,
    RuleAssignmentsEO.LAST_UPDATE_LOGIN,
    RuleAssignmentsEO.ATTRIBUTE_CATEGORY,
    RuleAssignmentsEO.ATTRIBUTE1,
    RuleAssignmentsEO.ATTRIBUTE2,
    RuleAssignmentsEO.ATTRIBUTE3,
    RuleAssignmentsEO.ATTRIBUTE4,
    RuleAssignmentsEO.ATTRIBUTE5,
    RuleAssignmentsEO.ATTRIBUTE6,
    RuleAssignmentsEO.ATTRIBUTE7,
    RuleAssignmentsEO.ATTRIBUTE8,
    RuleAssignmentsEO.ATTRIBUTE9,
    RuleAssignmentsEO.ATTRIBUTE10,
    RuleAssignmentsEO.ATTRIBUTE11,
    RuleAssignmentsEO.ATTRIBUTE12,
    RuleAssignmentsEO.ATTRIBUTE13,
    RuleAssignmentsEO.ATTRIBUTE14,
    RuleAssignmentsEO.ATTRIBUTE15,
    RuleAssignmentsEO.GROUP_MEMBER_CREDIT_FLAG,
    RuleAssignmentsEO.SUMMARY_FLAG,
    ParticipantEO.PARTICIPANT_NAME,
    ParticipantEO.PARTICIPANT_ID
    FROM CN_RS_RULE_ASSIGNMENTS_ALL RuleAssignmentsEO, CN_SRP_PARTICIPANT_HDR_RO_V ParticipantEO
    WHERE RuleAssignmentsEO.ASSIGNED_OBJECT_ID = ParticipantEO.PARTICIPANT_ID(+)) QRSLT WHERE RuleAssignmentsEO.RULE_ID = :Bind_RuleId AND RuleAssignmentsEO.ORG_ID = :Bind_OrgId) "
    Edited by: Vik2 on Oct 23, 2012 11:30 AM

    invalid identifier means ,it representating that field currently not available in db-table.
    so please refer db-table. whether field avialable or not?.
    edited lately:
    djbo.debugoutput=console did you use this :) it will say the query is send to server.
    Edited by: user707 on Oct 22, 2012 11:58 PM

  • Parent-child hierarcy - row level security

    Hi,
    Im using OBI 11.1.1.5 and have a problem about row-level security in parent-child dimension.
    I have created a parent-child dimension, simlar to:
    a1
    --a1.1
    ----a1.1.1
    ----a1.1.2
    --a1.2
    ----a1.2.1
    By using a session variable 'SESVAR1', I want to restrict the visible hierarcy. For instance user 'a1.1' should only see:
    a1.1
    --a1.1.1
    --a1.1.2
    To do this I created a parent-child closure table with the whole dataset. Then I created a physical table using select statement with my session variable in repository. Whenever I viewed data in repository, it showed the correct set.
    I created a parent-child dimension, using the original parent-child closure table. But since current distance values are different from the original hierarcy, I can not managed to build a security such a security system with this method.
    How can I build a security system, that a member can only see its child hierarchy only?
    Thanks for answers and links...
    Edited by: user4516917 on 16.Nis.2012 06:54
    Edited by: user4516917 on 16.Nis.2012 06:55

    According to searches I made in support.oracle and google, it seems that it is not possible to view just a branch of a parent-child tree. Because the closure table is static. Therefore, you can not change the distances of objects dynamically.
    This parent-child ability is very frustrating for me. As I understand, parent-child dimension ability can only be used in read-only sources. Any filtering or dynamic changes does not seem possible in this structure. Any changes on parent-child table requires parent-child relation table to be rebuilt.
    I couldnt find any functionality of indexcol or choose functions in parent-child dimensions. I think they can only be used in level based dimensions.
    Any comments appriciated..

  • Parent Child Relationship in the table to be queried.

    Hi guys,
    I have the below query.
    Table 1:
    Column_name Reference
    Value1 Value1
    Value2 Value1
    Table 2:
    Column_name Attributes(child Elements)
    Value1 Child1
    Value1 Child2
    Now my query is to retrieve records as below using both the tables.
    Value1
    Value1.Child1
    Value1.Child2
    Value2
    Value2.Child1
    Value2.Child2
    How can I get such ?
    Regards,
    SQL Developer.

    Hi,
    As Alex said, you should have tried by joining them.
    With Parent As (
    select 'Value1' p_col1,'Value1' P_col2 from dual union all
    select 'Value2','Value1' from dual),
    child as (
    select 'Value1' c_col1,'Child1' c_col2 from dual union all
    select 'Value1','Child2' from dual)
    -- End of sample data
    select p_col1,null c_col2 from parent
    union
    select p_col1,c_col2 from parent,child
    where p_col2=c_col1
    order by p_col1,c_col2 desc
    PRAZY@11gR1> /
    P_COL1 C_COL2
    Value1
    Value1 Child2
    Value1 Child1
    Value2
    Value2 Child2
    Value2 Child1
    6 rows selected.
    Elapsed: 00:00:00.03Regards,
    Prazy

Maybe you are looking for