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>

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

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

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

  • 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

  • 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

  • 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

  • The Parent-Child Hierarchy can't be queried in any intermediate node

    Hi All,
    I've created a Parent-Child Hierarchy with Obiee 11g(11.1.1.3).
    I can use the filter to select any Root-Node and it can be expanded correctly.But if I choose any intermediate node,it can't be expanded.Then what can I do?
    Thanks in advance!
    Edited by: Needn on 2011-9-8 下午8:42

    Thx for your advice,but my qusetion has not been solved.
    I don't know how to use these function in the analytics page.Must I modify its default SQL and apply mine?
    Its default SQL like the following ,then how can I modify it to achieve my purpose?
    SELECT s_0, s_1, s_2, s_3, s_4 FROM (
    SELECT
    *0 s_0,*
    *"model"."DIM_PROD_COST_CATEGORY"."CATEGORY_NAME" s_1,*
    CASE WHEN ISLEAF("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim") THEN 1 ELSE 0 END s_2,
    IDOF("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim") s_3,
    PARENT("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim") s_4
    FROM "model"
    WHERE
    ISROOT("model"."DIM_PROD_COST_CATEGORY"."DIM_PROD_COST_CATEGORYDim")
    *) djm ORDER BY 1*

  • How to remove  child query link from parent query for RRI

    Hi Floks,
    Long back we have created one RRI report(which is having parent child relation).Currently i wanted to remove this link or relation (i.e remove child report) between them.
    I tried From  t-code RSBBS but i could n't.  Please give me some inputs to fix this.
    Regards,
    Satya.

    Hi Satya,
    In the TCode RSBBS ,did u try deleting the assignments itself ..........save it and transport it ...........
    Rgds
    SVU123

  • Getting parent-child data from a single column in a table

    Hi,
    I have a parent-child data in a column.
    Eg:
    0
    00
    01
    010
    011
    1
    10
    11
    These values are present in the single column itself. My need is to get the parent values for the given child value.
    For eg: If I am giving the input as 011, the query should return all its parents, i.e. 01 and 0
    Could you please give me any inputs on this?
    Thanks,
    GV

    Frank Kulash wrote:
    Assuming that each child's id is formed by adding exactly one character to the end of its parent's id:
    SELECT     id
    FROM     table_x
    START WITH     id          = :target_id
    CONNECT BY     PRIOR id     LIKE id || '_';
    Small tweak to yours Frank if it's just the parents that need identifying...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select '0' as x from dual union all
      2             select '00' from dual union all
      3             select '01' from dual union all
      4             select '010' from dual union all
      5             select '011' from dual union all
      6             select '1' from dual union all
      7             select '10' from dual union all
      8             select '11' from dual)
      9  -- end of test data
    10  SELECT     x
    11  FROM       t, (select '&required' as req from dual) req
    12  WHERE x != req.req
    13  START WITH x = req.req
    14* CONNECT BY PRIOR x LIKE x || '_'
    SQL> /
    Enter value for required: 011
    old  11: FROM   t, (select '&required' as req from dual) req
    new  11: FROM   t, (select '011' as req from dual) req
    X
    01
    0
    SQL> /
    Enter value for required: 11
    old  11: FROM   t, (select '&required' as req from dual) req
    new  11: FROM   t, (select '11' as req from dual) req
    X
    1
    SQL>

Maybe you are looking for

  • The operation can't be completed because an unexpected error occurred (error code -8072).

    I am trying to delete some old files off my MacBook Pro and keep getting this error message, no matter what I do! I have perused a good number of Apple Support topics with similar error message, especially those for error code -8058 (as that seems to

  • Change inbound delivery using /SPE/IDOC_INPUT_DESADV1

    Hello - We are creating an inbound delivery using the idoc function module /SPE/IDOC_INPUT_DESADV1.  I have need to be able to change an existing delivery via idoc processing, so we are populating and mapping an E1EDL18 segment with the qualifier 'CH

  • Can query serial port with NI MAX, but doesn't work in Labview

    I'm trying to control a Coherent Sapphire 488 with labview. It's connected via a serial to USB converter into the computer. I can communicate with a device using NI MAX, but when I try to run the vi (attached), it works for several queries, but evetu

  • Difficulty restarting Powerbook

    A bit of background: a few months ago my PB G4 started 'freezing' fairly frequently--when I moved it, i.e. shifted it on my lap or moved to another room. By freeze I mean everything unresponsive, cursor doesn't move. I always had to do a hard shutdow

  • Status stuck on away, doesn't change

    Hello, For some days now. (After I have logged in to my skype account from my home, I usually use it at work), my account is constatly stuck on away. Actually other users see me as away. I can change statuses but there is no actual effect. Other user