Parent child query help

my requirement:
3 columns in table
column a    column b   data column
10          9     
13              10       acb
12              13       rerer
15          17     
16              15      
20          16     iiio
output:
column a    column b   data column
13              10       acb
20          16     iiioThanks.
Edited by: user12988565 on Apr 14, 2010 1:59 PM
Edited by: user12988565 on Apr 14, 2010 2:00 PM

Hi All,
Please let me know for any more details:
column a    column b   data column
10          9     
13              10       acb
12              13       rerer
15          17     
16              15      
20          16     iiio
output:
column a    column b   data column
13              10       acb
20          16     iiiohow the output is reached at?
1st set
10 - 9
13 - 10 acb -- data found, display the data. though for 13 there was rerer data in data column
2nd set
15 - 17
16 - 15
20 - 16 iiio -- data found display the data.
Thanks.

Similar Messages

  • Parent-Child querying in Web Service 2.0

    Hello,
    Our team has just started to work on the integration from ws 1.0 to ws 2.0. One tuff issue that we meet and we are searching for help is:
    Since from ws 2.0 all objects are exposed at the same level and the attachements child objects are not exposed (compared to the ws 1.0 which attach childs along ListOfXXX with parents), we are wondering how then to querying these child objects now ? More explicitly, with knowing the parent object, how to retrieve its child objects ? Or it becomes impossible since ws 2.0 ?
    This issue is really confusing us now, and we did not find the answer from the new "Oracle Web Service On Demand Guilde v4.0".
    Any help/answer/comment/suggestion on this issue would be greatly appreciate !
    Fang

    Hi all,
    Thanks for your replies. Well at this point, i must say it's really a dispointment for the 2.0 release which is supposed to (at least seems suppose to) replace the previous one.
    Could you please give us an idea that is the query by chilid feature will be implement in future release and if it is when ?
    Thanks again for your clarifications.
    Fang

  • Parent Child Query

    I have records in the table in this format without any sequence
    Code Name Parent_Coe
    1000 ABC 0
    2000 ABC 0
    3000 ABC 0
    4000 ABC 0
    9000 ABC 0
    5000 ABC 1000
    6000 ABC 5000
    7000 ABC 6000
    8000 ABC 2000
    i want all child come under there parents just like this.
    Code Name Parent_Coe
    1000 ABC 0
    5000 ABC 1000
    6000 ABC 5000
    7000 ABC 6000
    2000 ABC 0
    8000 ABC 2000
    3000 ABC 0
    4000 ABC 0
    9000 ABC 0
    Query Please???

    SQL> ed
    Zapisano file afiedt.buf
      1  WITH d AS (
      2   SELECT 1000 c1, 'ABC' c2, 0 c3 FROM dual UNION ALL
      3   SELECT 2000, 'ABC', 0 FROM dual UNION ALL
      4   SELECT 3000, 'ABC', 0 FROM dual UNION ALL
      5   SELECT 4000, 'ABC', 0 FROM dual UNION ALL
      6   SELECT 9000, 'ABC', 0 FROM dual UNION ALL
      7   SELECT 5000, 'ABC', 1000 FROM dual UNION ALL
      8   SELECT 6000, 'ABC', 5000 FROM dual UNION ALL
      9   SELECT 7000, 'ABC', 6000 FROM dual UNION ALL
    10   SELECT 8000, 'ABC', 2000 FROM dual)
    11  SELECT * FROM d
    12   START WITH c3 = 0
    13   CONNECT BY PRIOR c1 = c3
    14*  ORDER SIBLINGS BY c1
    SQL> /
            C1 C2          C3
          1000 ABC          0
          5000 ABC       1000
          6000 ABC       5000
          7000 ABC       6000
          2000 ABC          0
          8000 ABC       2000
          3000 ABC          0
          4000 ABC          0
          9000 ABC          0
    9 wierszy zosta│o wybranych.
    SQL>

  • Add/remove parent, child objects. help needed

    I'm working on interactive map for my client. But i'm stuck on functionality.
    It's basically has 3 locations (child1-3) on base map(Bg), each stands for link to their assigned popup boxes.
    Child2 and Child3 shares same Mag object which shows additional 5 locations.
    i've done showing my base Bg and 3 initial locations. Also i tried to show first popup box by clicking child1 and it has some success.
    But further i'm having problem for removing Box1 and it's BoxX button which means i want to return my Main_MC state by removing objects.
    **pls help me on my work so i'll appreciate for your valuable time for helping me. I'm open to send some bonus via Skrill or Paypal.
    Main_MC (parent)+
    |
    |___Bg
    |
    |
    |___child1+
    |              |___ Box1
    |             
    |___child2+
    |              |
    |              |                       |__box2
    |              |                       |__box3
    |              |___Mag+___|__box4
    |              |                       |__box5
    |              |                       |__box6
    |              |
    |              |
    |              |
    |___child3+
    Here is my toddler looking code i just started.
    package{
        import flash.display.Sprite;
        import flash.display.DisplayObject;
        import flash.events.MouseEvent;
        import flash.net.URLRequest;
        import flash.events.Event;   
        public class Main extends Sprite{
            private var Bg:Sprite;
            private var child1:Sprite;
            private var child2:Sprite;
            private var child3:Sprite;
            public function Main(){           
                var Bg:Sprite = new BgInstance();
                Bg.x=360;
                Bg.y=212;
                Bg.name="BgMap"
                addChild(Bg);
                child1 = new child1Instance();
                child1.buttonMode = true;
                child1.x=479;
                child1.y=132;
                child1.name="child1Name";
                child1.addEventListener(MouseEvent.CLICK, showBox);
                addChild(child1);
                child2 = new child2Instance();
                child2.buttonMode = true;
                child2.x=463;
                child2.y=282;
                child2.name="child2Name";
                child2.addEventListener(MouseEvent.CLICK, showMag);
                addChild(child2);
                child3 = new child3Instance();
                child3.buttonMode = true;
                child3.x=389;
                child3.y=335;
                child3.name="child3Name";
                addChild(child3);
            } //closing brace for Function Main     
            //Handler       
            private function showBox (e:MouseEvent):void{
                var box1:Sprite;
                box1=new box1Instance();
                box1.x=-279;
                box1.y=-32;
                box1.name = "box1name";
                var boxX:Sprite;
                boxX=new boxXInstance();
                boxX.x=-159;
                boxX.y=-79;
                boxX.name="boxXname";
                buttonMode = true;
                child1.addChild(box1);
                child1.addChild(boxX);           
                trace(child1.numChildren); //it returns 3 instead of 2 ?
                trace(box1.numChildren); //it returns 3 instead of 0 ?
                boxX.addEventListener(MouseEvent.CLICK, boxXHandler);
                } //closing brace for function showBox
                //function for removing showBox
            private function boxXHandler(evt:MouseEvent):void {
                child1.removeChildAt(0); // it removes child1 itself on first click?
                }//closing brace for function boxXHandler
                //function for managing showMag
            private function showMag (e:MouseEvent):void{
                var MagBox:Sprite;
                MagBox=new MagInstance();
                MagBox.x=-275;
                MagBox.y=-95;
                MagBox.name="MagBoxName";
                var MagBoxX:Sprite;
                MagBoxX=new magXInstance();
                buttonMode = true;
                MagBoxX.x=-145;
                MagBoxX.y=-190;
                MagBoxX.name="MagBoxXName";
                child2.addChild(MagBox);
                child2.addChild(MagBoxX);
                trace(child2.getChildAt(0).name);
                MagBoxX.addEventListener(MouseEvent.CLICK, MagBoxXHandler);
            } //closing brace for function showMag
            private function MagBoxXHandler(evt:MouseEvent):void {
        } //closing brace for Class Main
    } //closing brace for package

    This is my code for right now:
    package{
        import flash.display.Sprite;
        import flash.display.DisplayObject;
        import flash.events.MouseEvent;
        import flash.net.URLRequest;
        import flash.events.Event;
              import flash.events.EventDispatcher;
        public class Main extends Sprite{
            private var Bg:Sprite;
            private var child1:Sprite;
            private var child2:Sprite;
            private var child3:Sprite;
            public function Main(){           
                var Bg:Sprite = new BgInstance();
                Bg.x=360;
                Bg.y=212;
                Bg.name="BgMap"
                addChild(Bg);
                child1 = new child1Instance();
                child1.buttonMode = true;
                child1.x=479;
                child1.y=132;
                child1.name="child1Name";
                child1.addEventListener(MouseEvent.CLICK, showBox);
                addChild(child1);
                child2 = new child2Instance();
                child2.buttonMode = true;
                child2.x=463;
                child2.y=282;
                child2.name="child2Name";
                child2.addEventListener(MouseEvent.CLICK, showMag);
                addChild(child2);
                child3 = new child3Instance();
                child3.buttonMode = true;
                child3.x=389;
                child3.y=335;
                child3.name="child3Name";
                addChild(child3);
           } //closing brace for Function Main     
                //Handler
                private function showBox (e:MouseEvent):void{
                var box1:Sprite;
                box1=new box1Instance();
                box1.x=-279;
                box1.y=-32;
                box1.name = "box1name";
                var boxX:Sprite;
                boxX=new boxXInstance();
                boxX.x=-159;
                boxX.y=-79;
                boxX.name="boxXname";
                buttonMode = true;
                child1.addChild(box1);
                child1.addChild(boxX);
                child1.removeEventListener(MouseEvent.CLICK, showBox);
                //tired to remove event listerner for child1 ?
                boxX.addEventListener(MouseEvent.CLICK, boxXHandler);
                } //closing brace for function showBox
                //function for removing showBox
                function boxXHandler(evt:MouseEvent){
                child1.removeChild(child1.getChildByName("box1name"));
                child1.removeChild(child1.getChildByName("boxXname"));
                child1.addEventListener(MouseEvent.CLICK, showBox);
                // tried to reassign event listener for child1 ?
                }//closing brace for function boxXHandler
                //function for managing showMag
                private function showMag (e:MouseEvent):void{
                var MagBox:Sprite;
                MagBox=new MagInstance();
                MagBox.x=-275;
                MagBox.y=-95;
                MagBox.name="MagBoxName";
                var MagBoxX:Sprite;
                MagBoxX=new magXInstance();
                buttonMode = true;
                MagBoxX.x=-145;
                MagBoxX.y=-190;
                MagBoxX.name="MagBoxXName";
                child2.addChild(MagBox);
                child2.addChild(MagBoxX);
                child2.removeEventListener(MouseEvent.CLICK, showMag);
                trace(child2.getChildAt(0).name);
                MagBoxX.addEventListener(MouseEvent.CLICK, MagBoxXHandler);
                } //closing brace for function showMag
                function MagBoxXHandler(evt:MouseEvent):void {
                child2.removeChild(child2.getChildByName("MagBoxName"));
                child2.removeChild(child2.getChildByName("MagBoxXName"));
                child2.addEventListener(MouseEvent.CLICK, showMag);
              } //closing brace for Class Main
    } //closing brace for package

  • Parent Child Query Solution Required

    Hi All,
    I am developing an accounting application...I have two tables...CHARTS & DETAILS. FOLLOWING IS THE STURCTURE ALONGWITH SAMPLE DATA.
    CHARTS
    ACC_CODE NUMBER(8)
    ACC_NAME VARCHAR2(50)
    PARENTAC NUMBER(8)
    SAMPLE DATA:
    ACC_CODE ....ACC_NAME....................PARENTAC...................................
    100000............CASH AT BANKS...............NULL .........................................
    100001............BANK OF AMERICA...........100000........................................
    100002............BANK OF ARKANSAS........100000........................................
    100003............BANK OF CALIFORNIA.......100000........................................
    DETAILS
    ACC_CODE NUMBER(8)
    VDATE DATE
    DEBIT NUMBER(13,2)
    CREDIT NUMBER(13,2)
    ACC_CODE ....VDATE....................DEBIT......................CREDIT....................
    100001............ 01-01-07.....................5,000...................................................
    100001............ 02-01-07.....................6,000...................................................
    100001............ 03-01-07.....................9,000...................................................
    100001............ 04-01-07.....................75,000.................................................
    100002............ 02-01-07......................................................6,500..................
    100002............ 03-01-07.....................................................12,870..................
    100002............ 04-01-07.......................................................5,000..................
    100002............ 05-01-07.......................................................9,850..................
    Now my user wants to enter the parent account code e.g 100000 means he/she wants to see the sum of debit and credits of all the accounts in details whos parent is 100000 ( CASH AT BANKS)...
    DESIRED RESULT IS :
    Account Code...................Sum OF Debit.............Sum of Credit.......................
    100001..................................95,000...........................0..................................
    100002......................................0............................34,220.............................
    can you please tell me what will be sql to pick data from both tables with sum.
    thanks

    To prove Laurent's SQL is working:
    SQL> create table charts
      2  as
      3  select 100000 acc_code, 'CASH AT BANKS' acc_name, cast(null as number(6)) parentac from dual union all
      4  select 100001, 'BANK OF AMERICA', 100000 from dual union all
      5  select 100002, 'BANK OF ARKANSAS', 100000 from dual union all
      6  select 100003, 'BANK OF CALIFORNIA', 100000 from dual
      7  /
    Tabel is aangemaakt.
    SQL> create table details
      2  as
      3  select 100001 acc_code, date '2007-01-01' vdate, 5000 debit, cast(null as number(6)) credit from dual union all
      4  select 100001, date '2007-01-02', 6000, null from dual union all
      5  select 100001, date '2007-01-03', 9000, null from dual union all
      6  select 100001, date '2007-01-04', 75000, null from dual union all
      7  select 100002, date '2007-01-02', null, 6500 from dual union all
      8  select 100002, date '2007-01-03', null, 12870 from dual union all
      9  select 100002, date '2007-01-04', null, 5000 from dual union all
    10  select 100002, date '2007-01-06', null, 9850 from dual
    11  /
    Tabel is aangemaakt.
    SQL> var P_PARENTAC number
    SQL> exec :P_PARENTAC := 100000
    PL/SQL-procedure is geslaagd.
    SQL> select d.acc_code "Account Code"
      2       , nvl(sum(d.debit),0) "Sum OF Debit"
      3       , nvl(sum(d.credit),0) "Sum of Credit"
      4    from details d
      5       , charts c
      6   where d.acc_code = c.acc_code
      7     and c.parentac = :P_PARENTAC
      8   group by d.acc_code
      9   order by d.acc_code
    10  /
                              Account Code                           Sum OF Debit                          Sum of Credit
                                    100001                                  95000                                      0
                                    100002                                      0                                  34220
    2 rijen zijn geselecteerd.Regards,
    Rob.

  • 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

  • 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

  • Help needed in retrieving parent child relationship values

    Hi,
    I have a requirement to get parent child relationship values as below.
    Ex: Address table
    cont cont_code state state_code
    C1 10 S1 1
    C1 10 S2 2
    C1 10 S3 3
    C2 20 S4 4
    C2 20 S5 5
    C3 30 S6 6
    C3 30 S7 7
    C3 30 S8 8
    I want a result of country/state and corresponding code like below.
    corresponding states should be displayed under each country with some space appended to it.
    Geography code
    C1 10
    S1 1
    S2 2
    S3 3
    C2 20
    S4 4
    S5 5
    C3 30
    S6 6
    S7 7
    S8 8
    I am using oracle 10g version.
    Thanks in advance.

    Hi,
    When you post formatted text (like your output) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    I think you're saying that you want this output:GEOGRAPHY CODE
    C1 10
    S1 1
    S2 2
    S3 3
    C2 20
    S4 4
    S5 5
    C3 30
    S6 6
    S7 7
    S8 8
    If so, UNION, as Hoek suggested, is a good way.
    GROUP BY ROLLUP is more efficient, but harder to understand:SELECT     CASE
              WHEN GROUPING (state) = 1
              THEN cont
              ELSE ' ' || state
         END          AS geography
    ,      CASE
              WHEN GROUPING (state) = 1
              THEN MAX (cont_code)
              ELSE MAX (state_code)
         END          AS code
    FROM     t
    GROUP BY cont
    ,      ROLLUP (state)
    ORDER BY cont
    ,      state          NULLS FIRST
    By the way, this looks like a bad table design.
    In a relational database, the fact that the name 'C1' belongs to cont_code 10 should only be stored in one place.  You have the same information on 3 separate rows.
    Also, if 'C1' and 'S1' are both names, they should probably be in the same column, so that (to give just one example) you can find the information about 'x1' without knowing if it is a cont or a state.
    A better design would be.NAME     CODE     PARENT     DSCR
    ====     ====     ======     ====
    C1     10          CONT
    S1     1     10     STATE
    S2     2     10     STATE
    S3     3     10     STATE
    C2     20          CONT
    S4     4     20     STATE
    S5     5     20     STATE
    C3     30          CONT
    S6     6     30     STATE
    S7     7     30     STATE
    S8     8     30     STATE
    If the data is this simple, then the dscr column isn't needed.  Whether parent is NULL or not tells whether the rows represents a cont or a state.
    To get the results you want from a table like this, you could use CONNECT BY.  Using either UNION or ROLLUP, you have to know, at the time you write the query, how many levels there will be in the parent-child tree, and the length of the code is proportional to that depth, and the table has to be changed if you ever need to add another level.  CONNECT BY can handle any number of levels, and the length and complexity of the code is the same whether you have just 2 levels (countries and strates), or 7 levels (continents, regions, countiries, states, districts, cities and neighborhoods) or 72 levels.  The table doesn't need any more columns, no matter how deep the tree gets.
    Edited by: Frank Kulash on Sep 16, 2010 11:54 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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 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

  • 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.

  • 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

  • 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.

  • Retrieve Parent Child Sub-Child recors in SQL Query

    I've a self reference table and it has Parent-Child-Subchild relation. I'm getting an output (from second answer http://stackoverflow.com/questions/16031000/get-records-containing-all-the-child-records-in-sql-server) as expected, but it's
    displaying results in below format.
    <parent id> - <name> - <code>
    <child id> - <name> - <code>
    <child id> - <name> - <code>
    <child id> - <name> - <code>
    <child id> - <name> - <code>
    <sub child id> - <name> - <code>
    <sub child id> - <name> - <code>
    <sub child id> - <name> - <code>
    I want to display the results like in below format with applying some indent style to distinguish parent\ child\sub-child relationship.
    <parent id> - <name> - <code>
    <child id> - <name> - <code>
    <child id> - <name> - <code>
    <sub child id> - <name> - <code>
    <sub child id> - <name> - <code>
    <child id> - <name> - <code>
    <child id> - <name> - <code>
    <sub child id> - <label> - <code>
    <child id> - <name> - <code>
    <child id> - <name> - <code>
    Please assist me on foumulating results as expected.

    BOL has a good example of doing this in the CTE topic.  See http://technet.microsoft.com/en-us/library/ms175972%28v=sql.105%29.aspx Here is a slightly modified
    version of what is in BOL.
    CREATE TABLE #MyEmployees
    EmployeeID smallint NOT NULL,
    FirstName nvarchar(30) NOT NULL,
    LastName nvarchar(40) NOT NULL,
    Title nvarchar(50) NOT NULL,
    DeptID smallint NOT NULL,
    ManagerID int NULL,
    CONSTRAINT PK_EmployeeID PRIMARY KEY CLUSTERED (EmployeeID ASC)
    -- Populate the table with values.
    INSERT INTO #MyEmployees VALUES
    (1, N'Ken', N'Sánchez', N'Chief Executive Officer',16,NULL)
    ,(273, N'Brian', N'Welcker', N'Vice President of Sales',3,1)
    ,(274, N'Stephen', N'Jiang', N'North American Sales Manager',3,273)
    ,(275, N'Michael', N'Blythe', N'Sales Representative',3,274)
    ,(276, N'Linda', N'Mitchell', N'Sales Representative',3,274)
    ,(285, N'Syed', N'Abbas', N'Pacific Sales Manager',3,273)
    ,(286, N'Lynn', N'Tsoflias', N'Sales Representative',3,285)
    ,(16, N'David',N'Bradley', N'Marketing Manager', 4, 273)
    ,(23, N'Mary', N'Gibson', N'Marketing Specialist', 4, 16);
    ; WITH DirectReports(Name, Title, EmployeeID, EmployeeLevel, Sort)
    AS (SELECT CONVERT(varchar(255), e.FirstName + ' ' + e.LastName),
    e.Title,
    e.EmployeeID,
    1,
    CONVERT(varchar(255), e.FirstName + ' ' + e.LastName)
    FROM #MyEmployees AS e
    WHERE e.ManagerID IS NULL
    UNION ALL
    SELECT CONVERT(varchar(255), REPLICATE (' ' , EmployeeLevel) +
    e.FirstName + ' ' + e.LastName),
    e.Title,
    e.EmployeeID,
    EmployeeLevel + 1,
    CONVERT (varchar(255), RTRIM(Sort) + '| ' + FirstName + ' ' +
    LastName)
    FROM #MyEmployees AS e
    JOIN DirectReports AS d ON e.ManagerID = d.EmployeeID
    SELECT EmployeeID, Name, Title, EmployeeLevel
    FROM DirectReports
    ORDER BY Sort;
    GO
    drop table #MyEmployees;
    Tom

Maybe you are looking for

  • Can't open Pages '09 Document (Upgraded to Mavericks and Pages 5.0))

    There is one Pages '09 file that I can not open now that I have upgraded to Mavericks and the new Pages.  Of course it is an assignment that my son needs for school!  When I double-click on it I get the message that the document could not be read, th

  • Can't download any file

    Hai iam using iPhone 5 and I can't download any file even a text please help me

  • Client side handling of exceptions thrown by a webservice

    I have a webservice that is deployed in Tomcat 5.5 running on Windows XP, Java version is 1.5, using jwsdp 1.5. My client, when run as an applet in a browser (have tried IE 6 and FireFox 1), seems to be unable to parse any exception thrown from the w

  • Errors while creating tracks in CMS

    Hi All, i have this error 'CBS (URL http://******:50100/tc.CBS.Appl/archiveapi2/) communication exception: Build Server request failed without CBS specific error code. HTTP status: 403 (Forbidden)' what can i do ?????? Message was edited by:        

  • Required solution manager key For Download SAP-IDES

    Hi All I need a list of items to download and install SAP Solution Manager Our IDES installation is not yet complete because of the required solution manager key. Thank you, Madhu Rao