Query Help - Embedded Select

Hi
The following Query will show me catalogue IDs and Descriptions of all the hired outfits
for each Branch, with the revenue generated in descending order....
SELECT Members_Order.Catalogue_ID, Item.Item_Description, Item.Colour Orders.Branch_ID, Item.Hire_Charge, Members_Order.Number_of_Days, (Hire_Charge*Number_of_Days) AS Total
From Members_Order, Item, Orders
WHERE Members_Order.Item_ID = Item.Item_ID
AND Members_Order.Order_ID = Orders.Order_ID
ORDER BY Total DESC;What i want to do now is to create a query to show the details of the outfits, which are the same colour as the outfit which has generated the most revenue. I'm guessing this will involve an embedded select, using the same basis of the query above, but i'm unsure as to what should go with the embedded select?
I have the following so far, could anyone help to finish it off or point me the the right direction....?
SELECT Members_Order.Catalogue_ID, Item.Item_Description, Item.Colour, Item.Hire_Charge, Members_Order.Number_of_Days, (Hire_Charge*Number_of_Days) AS Total
From Members_Order, Item, Orders
WHERE Members_Order.Item_ID = Item.Item_ID
AND Colour = (SELECT Colour FROM Item WHERE
;Edited by: user10945931 on 15-Apr-2009 19:50

Hello,
You can add count(*) and group by clause and using WITH clause. If you can post your table structure and some sample data that will be easier for us to help you out and if you like the challlegne and want to do it on your own then run start with above options. Also when you post code and output enclose them between \ to preseve formatting.
\your code or output goes here
\Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Query help in select Distinct on one column.

    CREATE GLOBAL TEMPORARY TABLE Table1 (
    ID1 varchar2(100) ,
    Name1 varchar2(100),
    Name11 varchar2(100)
    insert into Table1 values ('a','n1','h3');
    insert into Table1 values('b','n2','h2');
    insert into Table1 values('a','n3','h1');
    insert into Table1 values('c','n4','h5');
    insert into Table1 values ('c','n5','h4');
    insert into Table1 values('d','n6','h6');
    select * from Table1;
    ID1,NAME1,     NAME11
    a,     n1,     h3
    b,     n2,     h2
    a,     n3,     h1
    c,     n4,     h5
    c,     n5,     h4
    d,     n6,     h6
    I am trying to select distinct ID1 and all values associated with it which is max row.I want to result as -
    ID1,NAME1,     NAME11
    a,     n3,     h1
    b,     n2,     h2
    c,     n5,     h4
    d,     n6,     h6
    Can you please help me to write simple query to get above result.
    Edited by: 871447 on Jul 25, 2011 9:42 AM
    Edited by: 871447 on Jul 25, 2011 9:45 AM

    Hi,
    Do a self-join, to combine the two rows for each value of id1 onto one output row.
    Make it an outer join, in case there is only one row with a vlaue for id1.
    SELECT  l.id1
    ,     l.name1
    ,     NVL ( r.name11
             , l.name11
             )          AS name11
    FROM              table1     l
    LEFT OUTER JOIN     table1     r  ON  l.id1     = r.id1
                              AND l.name1     < r.name1
    ;Edited by: Frank Kulash on Jul 25, 2011 12:57 PM
    Sorry, I mis-read the problem.
    Lee's solution, above, assumes that name1 is unique, as it is in your sample data.
    What output would you want if that's not the case?
    If name1 is not unique, but the combination of (id1, name1) is unique, then you can modify Lee's solution like this:
    SELECT  *
    FROM    table1
    WHERE   (id1, name1) IN (
                        SELECT    id1
                        ,       MAX (name1)
                               FROM          table1
                        GROUP BY  id1
    ;Or, if you can't make any assumptions about uniqueness, you might need something like this:
    WITH     got_r_num     AS
         SELECT  id1, name1, name11
         ,     ROW_NUMBER () OVER ( PARTITION BY  id1
                                   ORDER BY          name1     DESC
                             ,                name11     DESC
                           )      AS r_num
         FROM     table1
    SELECT  id1, name1, name11
    FROM     got_r_num
    WHERE     r_num     = 1
    ;

  • Query help - problems with ROLLUP

    I'm trying to make a query i can use for an alert, it generates sales for the past 7 days.
    This query works fine:
    SELECT
          CASE WHEN GROUPING(T0.[CardCode]) = 0
                THEN CAST (T0.[CardCode] AS CHAR(8))
                ELSE 'ALL'
          END AS Customer#,
          SUM(T0.[Max1099]) AS "Total Sales",
          SUM(T0.[GrosProfit]) AS "Gross Profit" 
    FROM OINV T0
    WHERE T0.[DocDate] >= DATEADD(dd,DATEDIFF(dd,0,GETDATE())-7,0) AND T0.[Max1099] > 0
    GROUP BY T0.[CardCode] WITH ROLLUP
    And it gives me this:
    #     Customer#*     Total Sales*     Gross Profit*     
    1     C2235              8,285.87       4,165.77            
    2     C2236           10,191.39              4,197.95            
    3     C2253                570.56               311.17          
    4     C3008           18,756.76       5,720.21            
    5     ALL                   37,804.58    14,395.10            
    Which is great. Gives me a total at the end, and substitutes "ALL" for the customer number. Lovely.
    Problem #1: I REALLY want it to give the Customer Name NEXT TO the Customer Number. But when I try to add it, i have to add it to the GROUP BY as well. Which changes the query to this:
    SELECT
          CASE WHEN GROUPING(T0.[CardCode]) = 0
                THEN CAST (T0.[CardCode] AS CHAR(8))
                ELSE 'ALL'
          END AS Customer#,    
          CardName as "Cust Name",     
          SUM(T0.[Max1099]) AS "Total Sales",
          SUM(T0.[GrosProfit]) AS "Gross Profit"
    FROM OINV T0
    WHERE T0.[DocDate] >= DATEADD(dd,DATEDIFF(dd,0,GETDATE())-7,0) AND T0.[Max1099] > 0
    GROUP BY T0.[CardCode], T0.[CardName] WITH ROLLUP
    And changes my output to THIS:
    #     Customer#     Cust Name                             Total Sales     Gross Profit     
    1     C2235             Acme Products                      8,285.87               4,165.77     
    2     C2235          (blanks blanks)                        8,285.87               4,165.77     
    3     C2236             Some Other Products             10,191.39               4,197.95     
    4     C2236          (blanks blanks blanks)            10,191.39               4,197.95     
    5     C2253             Third Customer Name             570.56                  311.17     
    6     C2253          (blanks blanks blanks)                570.56                  311.17     
    7     C3008             Fourth Customer Name       18,756.76       5,720.21     
    8     C3008          (blanks blanks blanks)                                               18,756.76       5,720.21     
    9     ALL                                                                  37,804.58     14,395.10     
    ( I have replaced actual customer names, of course, and replaces actual blanks with the word 'blanks' so it would be more legible.)
    I can't figure out a way to simply list the customer name next to the number. Instead , it gives me a summary for the CardCode and a summary for the CardName.
    I've tried combining the two into one field, on the fly, but haven't been successful.
    Problem #2 - extra credit!
    If i really want this done right, i should also have a query that pulls the same data from ORIN (Credit Memos) and do a UNION ALL, but when i do this, is simply rejects me at the word "UNION"
    any and all help appreciated, and to test this, you can just cut and past the query into SAP, it will run right there, no mods needed.
    oops. I had to change the "Not Equal" symbol to just "greater than" for "Max1099" because it was just dropping the symbol...
    Edited by: Dante Amodeo on Jan 18, 2012 6:30 PM

    Try:
    SELECT CAST (T0.CardCode AS CHAR(8)) AS Customer#,
    MAX(T0.CardName) 'Customer Name',
    SUM(T0.Max1099) AS 'Total Sales',
    SUM(T0.GrosProfit) AS 'Gross Profit'
    FROM OINV T0
    WHERE DATEDIFF(dd,T0.DocDate,GETDATE())<=7 AND T0.Max1099 > 0
    GROUP BY T0.CardCode
    UNION ALL
    SELECT 'ALL','',SUM(T0.Max1099),
    SUM(T0.GrosProfit)
    FROM OINV T0
    WHERE DATEDIFF(dd,T0.DocDate,GETDATE())<=7 AND T0.Max1099 > 0

  • Query help required to link two fields

    Hi all,
    I have made an query as under :
    SELECT T2.Period, T0.dept, T0.empID, T0.firstName, T0.lastName, T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, T1.U_emeins, T1.U_education, T1.U_grosssal,T1.U_totduc, T1.U_oadd, T1.U_netsal, T1.U_bank, T1.U_branch, T1.U_accno FROM OHEM T0 , [dbo].[@PAYROLL_PR_DETAIL]  T1, [dbo].[@PAYROLL_PROLL_HEAD]  T2 where t2.docentry=t1.docentry and t1.U_ecode=t0.empid
    Now I want that the Department Full NAME as mentioned in the Human Resource screen for that employee should come. Apart from it I also want to link a new field in this query user_code from OUSR table for each employee.
    Can you please help me to make this query.
    Regards,
    kamlesh

    Dear Gordon,
    After rectifiying the spelling mistake I used the following query as under
    SELECT T2.Period, T0.dept, T3.Name, T0.empID, T0.firstName, T0.lastName, T4.USER_CODE,T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, T1.U_emeins, T1.U_education, T1.U_grosssal,T1.U_totduc, T1.U_oadd, T1.U_netsal, T1.U_bank, T1.U_branch, T1.U_accno
    FROM dbo.OHEM T0
    INNER JOIN dbo.OUDP T3 ON T3.Code = T0.dept
    INNER JOIN dbo.OUSR T4 ON T4.INTERNAL_K = T0.userId
    INNER JOIN dbo.@PAYROLL_PR_DETAIL T1 ON t1.U_ecode=t0.empid
    INNER JOIN dbo.@PAYROLL_PROLL_HEAD T2 ON t2.docentry=t1.docentry
    but now the syntax error is coming as - 'Incorrect syntax near '@PAYROLL_PR_DETAIL'
    (SEWSY) (s) could not be prepared
    Please guide.
    Regards,
    Kamlesh

  • Query help,  Percentages / ratio to reports / nests

    Hi
    I have a query that returns data like this
    D_NO POINTS COUNT_POINTS ID_COUNT
    4002 L_T_69 12 282
    4219 L_T_69 1 151
    4228 L_T_69 18 193
    4229 L_T_69 7 181
    4230 L_T_69 0 197
    I need to also output a column that works out a percentage of count_points and Id_count. e.g 12/282 * 100 = 4.2
    I had a try with ratio to reports function but no joy for me. I think i need to add in
    another nested select or something but what i was trying wasnt working.
    Can anyone help.
    here is the query so far
    SELECT D_NO,
    GROUPS.POINTS,
    DECODE(GROUPS.POINTS, 'L_T_69' , L_T_69) AS COUNT_POINTS,
    ID_COUNT
    FROM
         (SELECT D_NO,
         Count (CASE WHEN VERBAL <= 69 THEN 1
              END) AS L_T_69,
         COUNT(ID_NUMBER) AS ID_COUNT
         FROM TBL_1
         WHERE VERBAL IS NOT NULL
         group by D_NO)
    TBL_1,
    ( SELECT 'L_T_69' POINTS FROM DUAL )GROUPS
    thank you

    Not sure if this is what you're looking for but it may give you some clues:
    select object_type
          ,has_a_c
          ,type_total
          ,round(100 * (has_a_c / type_total),2) ratio
    from
       select object_type
             ,sum (case when instr(object_name,'C') <> 0 then 1
                        else 0
                   end) has_a_c
             ,count(*) type_total
       from   all_objects
       group by object_type
    OBJECT_TYPE          HAS_A_C   TYPE_TOTAL   RATIO
    CONSUMER GROUP             1            2      50
    EVALUATION CONTEXT         1            1     100
    FUNCTION                  50          113   44.25
    INDEX                      7           20      35
    LIBRARY                    0            2       0
    OPERATOR                   1            2      50
    PACKAGE                  500         1158   43.18
    PACKAGE BODY             487         1126   43.25
    PROCEDURE                 54           86   62.79
    SEQUENCE                  62          116   53.45
    SYNONYM                 1060         2298   46.13
    TABLE                    365          721   50.62
    TABLE PARTITION           15           15     100
    TYPE                     104          272   38.24
    VIEW                     834         1896   43.99
    15 rows selected.

  • BETWEEN DATE Query help

    Dear Experts, I am new to PL/SQL and need your expert advice and help on below query,
    SELECT * FROM SCHEMA.TABLE
    WHERE DATETIME BETWEEN (TO_DATE('SYSDATE-1 07:00:01','MM/DD/YYYY, HH24:MI:SS')) AND (TO_DATE('SYSDATE-1 14:59:59','MM/DD/YYYY, HH24:MI:SS'));
    I want to automate above query which will select yesterday data from mentioned starttime (07:00:01) to endtime (14:59:59).
    Please help.
    BR,

    Hi,
    DBA wrote:
    I am using below duration in between to get a complete day duration data (of yesterday),
    DTIME BETWEEN TRUNC(SYSDATE-1) + 0/24 + 1/12/60/60 AND TRUNC(SYSDATE-1) + 23/24 + 1799/12/60/60
    Is it valid for a complete one day duration (of yesterday)?
    Please help in clarifying this confusion.
    Bundle of thanks!If you have to ask, then that means it will be hard to debug and maintain.
    Here's a simpler way to find rows where dttime is after 7:00 AM yesterday, but before 3:00 PM yesterday:
    WHERE     dtime     >  TRUNC (SYSDATE - 1) + ( 7 / 24)
    AND     dtime     <  TRUNC (SYSDATE - 1) + (15 / 24)This will pick rows where dtime is as little as 1 second after 7:00 AM, but not 7:00 AM itself. If you want to include 7:00:00 exactly, change the > to >=.

  • Performance issues with query input variable selection in ODS

    Hi everyone
    We've upgraded from BW 3.0B to NW04s BI using SP12.
    There is a problem encountered with input variable selection. This happens regardless of using BEx (new or old 3.x) or using RSRT. When using the F4 search help (or "Select from list" in BEx context) to list possible values, this takes forever for large ODS (containing millions of records).
    Using ST01 and SM50 to trace the code in the same query, we see a difference here:
    <u>NW04s BI SQL command</u>
    SELECT                                                                               
    "P0000"."COMP_CODE" AS "0000000032" ,"T0000"."TXTMD" AS "0000000032_TXTMD"                             
    FROM                                                                               
    ( "/BI0/PCOMP_CODE" "P0000" ) LEFT OUTER JOIN "/BI0/TCOMP_CODE" "T0000" ON  "P0000"."COMP_CODE" = "T0000
      "."COMP_CODE"                                                                               
    WHERE                                                                               
    "P0000"."OBJVERS" = 'A' AND "P0000"."COMP_CODE" IN ( SELECT "O"."COMP_CODE" AS "KEY" FROM              
      "/BI0/APY_PP_C100" "O" )                                                                               
    ORDER BY                                                                               
    "P0000"."COMP_CODE" ASC#                                                                               
    <u>BW 3.0B SQL command:</u>
    SELECT ROWNUM < 500 ....
    In 3.0B, rownum is limited to 500 and this results in a speedy, though limited query. In the new NW04s BI, this renders the selection screen unusable as ABAP dumps for timing out will occur first due to the large data volume searched using sequential read.
    It will not be feasible to create indexes for every single query selection parameter (issues with oerformance when loading, space required etc.). Is there a reason why SAP seems have fallen back on a less effective code for this?
    I have tried to change the number of selected rows to <500 in BEx settings but one must reach a responsive screen in order to get to that setting and it is not always possible or saved for the next run.
    Anyone with similar experience or can provide help on this?

    here is a reason why the F4 help on ODS was faster in BW 3.x.
    In BW 3.x the ODS did not support the read mode "Only values in
    InfoProvider". So If I compare the different SQL statements I propose
    to change the F4 mode in the InfoProvider specific properties to
    "About master data". This is the fastest F4 mode.
    As an alternative you can define indexes on your ODS to speed up F4.
    So would need a non-unique index on InfoObject 0COMP_CODE in your ODS
    Check below for insights
    https://forums.sdn.sap.com/click.jspa?searchID=6224682&messageID=2841493
    Hope it Helps
    Chetan
    @CP..

  • SQL Query Help - Is this possible or impossible????

    Hi guys,
    I need help with an SQL query that I'm trying to develop. It's very easy to explain but when trying to implement it, I'm struggling to achieve the results that I want.....
    For example,
    I have 2 tables
    The first table is:
    1) COMPANY create table company (manufacturer varchar2(25),
                                                          date_established date,
                                                          location varchar2(25) );My sample test date is:
    insert into company values ('Ford', 1902, 'USA');
    insert into company values ('BMW', 1910, 'Germany');
    insert into company values ('Tata', 1922, 'India');The second table is:
    2) MODELS create table models (manufacturer varchar(25),
                                                 model varchar2(25),
                                                 price number(10),
                                                 year date,
                                                 current_production_status varchar2(1) ) ;My sample test data is:
    insert into models values ('Ford', 'Mondeo', 10000, 2010, 0);
    insert into models values ('Ford', 'Galaxy', 12000,   2008, 0);
    insert into models values ('Ford', 'Escort', 10000, 1992, 1);
    insert into models values ('BMW', '318', 17500, 2010, 0);
    insert into models values ('BMW', '535d', 32000,   2006, 0);
    insert into models values ('BMW', 'Z4', 10000, 1992, 0);
    insert into models values ('Tata', 'Safari', 4000, 1999, 0);
    insert into models values ('Tata', 'Sumo', 5500,   1996, 1);
    insert into models values ('Tata', 'Maruti', 3500, 1998, 0);And this is my query:
    SELECT
            com.manufacturer,
            com.date_established,
            com.location,
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.model),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.price),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.year),
            mod.current_production_status
    FROM
           company com,
           models mod
    WHERE
          mod.manufacturer = com.manufacturer
          and com.manufacturer IN ('Ford', 'BMW', 'Tata')
          and mod.current_production_status IN (1,0)
    ORDER BY
            mod.current_production_status DESCWhat I want the query to output is this:
    com.manufacturer        com.date_established          com.location          mod.model          mod.price             mod.year     mod.current_production_status
    Ford               1902                    USA               Escort               10000               1992          1
    BMW               1910                    Germany               -               -               -          0
    Tata               1922                    India               Sumo               5500               1998          1If current_production_status is 1 it means this particular model has been discontinued
    If current_production_status is 0 it means the manufacturer does not have any discontinued models and all are in procuction.
    The rule is only one record per manufacturer is allowed to have a current_production_status of 1 (so only one model from the selection the manufactuer offers is allowed to be discontinued).
    So the query should output the one row where current_production_status is 1 for each manufacturer.
    If for a given manufacturer there are no discontinued models and all have a current_production_status of 0 then ouput a SINGLE row that only includes the data from the COMPANY table (as above). The rest of the columns from the MODELS table should be populated with a '-' (hyphen).
    My query as it is above will output all the records where current status is 1 or 0 like this
    com.manufacturer        com.date_established          com.location          mod.model          mod.price          mod.year     mod.current_production_status
    Ford               1902                    USA               Escort               10000               1992          1
    Tata               1922                    India               Sumo               5500               1998          1
    Ford               1902                    USA               -               -               -          0                    
    Ford               1902                    USA               -               -               -          0
    BMW               1910                    Germany               -               -               -          0
    BMW               1910                    Germany               -               -               -          0
    BMW               1910                    Germany               -               -               -          0
    Tata               1922                    India               -               -               -          0
    Tata               1922                    India               -               -               -          0However this is not what I want.
    Any ideas how I can achieve the result I need?
    Thanks!
    P.S. Database version is '10.2.0.1.0'

    Hi Vishnu,
    Karthiks query helped...
    But this is the problem I am facing...
    SELECT
            com.manufacturer,
            com.date_established,
            com.location,
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.model),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.price),
            DECODE(nvl(mod.current_production_status, '0'), '0', '-', mod.year),
            mod.current_production_status
    FROM
           company com,
           models mod
    WHERE
          mod.manufacturer = com.manufacturer
          and com.manufacturer = 'Ford'
          and mod.current_production_status IN (1,0)
    ORDER BY
            mod.current_production_status DESCThe value of:
    and com.manufacturer = 'Ford'will be dependent on front end user input....
    When I run the query above I get all the rows where current_production_status is either 1 or 0.
    I only require the rows where current_production_status is 1.
    So if I amend it to look like this:
         and mod.current_production_status = 1This works....
    BUT if a user now passes in more than one manufacturer EG:
    and com.manufacturer IN ('Ford', 'BMW')The query will only return the one row for Ford where current_production_status is 1. However because BMW has no models where current_production_status is 1 (all 3 are 0), I still want this to be output - as one row....
    So like this:
    com.manufacturer        com.date_established          com.location          mod.model          mod.price             mod.year     mod.current_production_status
    Ford               1902                    USA               Escort               10000               1992          1
    BMW               1910                    Germany               -               -               -          0So (hopefully you understand), I want both cases to be catered for.....whether a user enters one manufacturer or more than one...
    Thanks you so much!
    This is really driving me insane :-(

  • XML QUERY HELP NEEDED

    Hi,
    Need help in writing a query.
    SQL> SELECT xmlelement("P",xmlforest(P.process_id AS Ppid),
      2   xmlagg(xmlelement("PI",XMLFOREST( PI.question_id AS PIqid,
      3   PI.process_id AS PIpid,
      4   PI.innertext AS PItext),
      5   xmlagg(Xmlelement("PO",xmlforest( PO.option_id AS POoid,
      6   PO.question_id AS POqid,
      7   PO.process_id AS popid
      8   ))
      9  ORDER BY PO.option_id))
    10     ORDER BY PI.question_id ) )
    11     FROM liveProcess_ec P
    12  INNER JOIN vw_liveProcessItem_Sim_v6 PI
    13       ON P.process_id = PI.process_id
    14  LEFT OUTER JOIN vw_liveProcessOption_Sim_v6 PO
    15       ON PI.question_id = PO.question_id
    16  AND PI.process_id      = PO.process_id
    17    WHERE p.process_id   =450
    18  GROUP BY p.process_id,PI.question_id,PI.process_id,PI.innertext
    19    ORDER BY p.process_id;
    SELECT xmlelement("P",xmlforest(P.process_id AS Ppid),
    ERROR at line 1:
    ORA-00937: not a single-group group functionThanks in advance

    Hi,
    Here below are the create table scripts along with sample data and expected output.
    CREATE TABLE VW_LIVEPROCESSOPTION_SIM_v6
    ( "OPTION_ID" NUMBER,
    "QUESTION_ID" NUMBER(10,0),
    "PROCESS_ID" NUMBER(10,0),
    "OPT_INNERTEXT" VARCHAR2(200 CHAR),
    "OPT_LINKFROM" VARCHAR2(20 CHAR),
    "OPT_LINKTO" VARCHAR2(20 CHAR),
    "LIBQUESTION_IDFK" NUMBER,
    "LIBOPTION_IDFK" NUMBER
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,2,450,'Yes',null,'5',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,3,450,'Yes',null,'5',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,5,450,'Yes',null,'6',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,6,450,'Yes',null,'7',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,8,450,'Block All',null,'9',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,9,450,'Yes',null,'10',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,11,450,'Yes',null,'12',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,12,450,'Yes',null,'13',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (1,14,450,'Yes',null,'16',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,2,450,'No',null,'3',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,3,450,'No',null,'4',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,5,450,'No',null,'8',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,6,450,'No',null,'8',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,8,450,'Standard',null,'11',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,9,450,'No',null,'11',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,11,450,'No',null,'14',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,12,450,'No',null,'14',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (2,14,450,'No',null,'15',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (3,8,450,'Disabled',null,'12',null,null);
    Insert into VW_LIVEPROCESSOPTION_SIM_v6(OPTION_ID,QUESTION_ID,PROCESS_ID,OPT_INNERTEXT,OPT_LINKFROM,OPT_LINKTO,LIBQUESTION_IDFK,LIBOPTION_IDFK) values (4,8,450,'User Defined',null,'12',null,null);
    REATE TABLE "VW_LIVEPROCESSITEM_SIM_v6"
    ( "QUESTION_ID" NUMBER(10,0),
    "PROCESS_ID" NUMBER(10,0),
    "INNERTEXT" VARCHAR2(200 CHAR),
    "ITEMTYPE" VARCHAR2(50 CHAR),
    "LINKFROM" VARCHAR2(500 CHAR),
    "LINKTO" VARCHAR2(500 CHAR),
    "ASSOCIATED" VARCHAR2(200 CHAR),
    "CONTENT_ID" NUMBER,
    "EXITPOINT1_ID" NUMBER(10,0),
    "EXITPOINT2_ID" NUMBER(10,0),
    "EXITPOINT3_ID" NUMBER(10,0),
    "RESOLVEIDENTIFIER" VARCHAR2(40 CHAR),
    "LIBQUESTION_IDFK" NUMBER(10,0),
    "FOLLOWONCALL" NUMBER(1,0),
    "USERINPUT" VARCHAR2(200 CHAR),
    "ISLOCKED" NUMBER(1,0),
    "PREVIOUSANSWER" NUMBER(1,0),
    "VISIBLETOAGENT" NUMBER(1,0),
    "RETRYATTEMPT" NUMBER(10,0),
    "TAGS" VARCHAR2(50 BYTE)
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (1,450,'CBB1015 - Router Firewall Settinngs Process','Title',null,'2',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (2,450,'Is the customers PC Firewall turned off?','Question','1','2.2,2.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (3,450,'Advise the customer to turn off the PC Firewall in order to continue. Has this been done?','Question','2.2','3.2,3.1',null,278,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (4,450,'Advise the customer the PC Firewall must be switched off before this process????','ExitPoint','3.2',null,null,null,14,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (5,450,'Is the customer able to access the internet now?','Question','3.1,2.1','5.2,5.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (6,450,'Is the customer having a problem with a specific website?','Question','5.1','6.2,6.1',null,null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (7,450,'1536: CBB1008 - Browser Setup and Daignostics','SubProcess','6.1',null,'1536-1-0',null,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (8,450,'What is the security level on the CPE Management page?','Question','6.2,5.2','8.4,8.3,8.2,8.1',null,279,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (9,450,'Change the security level to Standard. Does this resolve the customers issue?','Question','8.1','9.2,9.1',null,280,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (10,450,'Issue Resolved','ExitPoint','9.1',null,null,null,1,6,122,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (11,450,'Change the security level to Disabled. Is the customer able to browse the internet?','Question','9.2,8.2','11.2,11.1',null,281,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (12,450,'Change the security level to Standard. Is the customer able to browse the internet now?','Question','11.1,8.3,8.4','12.2,12.1',null,283,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (13,450,'Issue Resolved','ExitPoint','12.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (14,450,'Ask the customer to perform a master reset. Does this resolve their issue?','Question','12.2,11.2','14.2,14.1',null,282,null,null,null,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (15,450,'Faulty CPE','ExitPoint','14.2',null,null,null,1,6,124,null,null,null,null,null,null,null,null,null);
    Insert into VW_LIVEPROCESSITEM_SIM_v6 (QUESTION_ID,PROCESS_ID,INNERTEXT,ITEMTYPE,LINKFROM,LINKTO,ASSOCIATED,CONTENT_ID,EXITPOINT1_ID,EXITPOINT2_ID,EXITPOINT3_ID,RESOLVEIDENTIFIER,LIBQUESTION_IDFK,FOLLOWONCALL,USERINPUT,ISLOCKED,PREVIOUSANSWER,VISIBLETOAGENT,RETRYATTEMPT,TAGS) values (16,450,'Issue Resolved','ExitPoint','14.1',null,null,null,1,6,123,null,null,null,null,null,null,null,null,null);
    CREATE TABLE "LIVEPROCESS_EC_V"
    ( "PROCESS_ID" NUMBER(10,0),
    "USER_ID" NUMBER(10,0),
    "CREATED" TIMESTAMP (6)
    Insert into LIVEPROCESS_EC (PROCESS_ID,USER_ID,CREATED) values (450,7460,to_timestamp('21-APR-08 09.34.41.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));Expected Output
    <P>
      <Ppid>450</Ppid>
      <Pn>CBB1015 - Router Firewall Settinngs Process</Pn>
      <Pg>9</Pg>
      <Pl>0</Pl>
      <Pb>5</Pb>
      <qcount>100</qcount>
      <ocount>200</ocount>
      <PI>
        <PIqid>1</PIqid>
        <PIpid>450</PIpid>
        <PIpx>366</PIpx>
        <PIpy>-516</PIpy>
        <PItext>CBB1015 - Router Firewall Settinngs Process</PItext>
        <PItype>Title</PItype>
        <PIto>2</PIto>
        <PO />
      </PI>
      <PI>
        <PIqid>2</PIqid>
        <PIpid>450</PIpid>
        <PIpx>366</PIpx>
        <PIpy>-437</PIpy>
        <PItext>Is the customers PC Firewall turned off?</PItext>
        <PItype>Question</PItype>
        <PIfrom>1</PIfrom>
        <PIto>2.2,2.1</PIto>
        <PO>
          <POoid>1</POoid>
          <POqid>2</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>5</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>2</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>3</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>3</PIqid>
        <PIpid>450</PIpid>
        <PIpx>468</PIpx>
        <PIpy>-344</PIpy>
        <PItext>Advise the customer to turn off the PC Firewall in order to continue. Has this been done?</PItext>
        <PItype>Question</PItype>
        <PIfrom>2.2</PIfrom>
        <PIto>3.2,3.1</PIto>
        <PIc>278</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>3</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>5</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>3</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>4</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>4</PIqid>
        <PIpid>450</PIpid>
        <PIpx>571</PIpx>
        <PIpy>-250</PIpy>
        <PItext>Advise the customer the PC Firewall must be switched off before this process????</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>3.2</PIfrom>
        <PIe1>14</PIe1>
        <PO />
      </PI>
      <PI>
        <PIqid>5</PIqid>
        <PIpid>450</PIpid>
        <PIpx>374</PIpx>
        <PIpy>-240</PIpy>
        <PItext>Is the customer able to access the internet now?</PItext>
        <PItype>Question</PItype>
        <PIfrom>3.1,2.1</PIfrom>
        <PIto>5.2,5.1</PIto>
        <PO>
          <POoid>1</POoid>
          <POqid>5</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>6</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>5</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>8</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>6</PIqid>
        <PIpid>450</PIpid>
        <PIpx>322</PIpx>
        <PIpy>-141</PIpy>
        <PItext>Is the customer having a problem with a specific website?</PItext>
        <PItype>Question</PItype>
        <PIfrom>5.1</PIfrom>
        <PIto>6.2,6.1</PIto>
        <PO>
          <POoid>1</POoid>
          <POqid>6</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>7</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>6</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>8</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>7</PIqid>
        <PIpid>450</PIpid>
        <PIpx>128</PIpx>
        <PIpy>-36</PIpy>
        <PItext>1536: CBB1008 - Browser Setup and Daignostics</PItext>
        <PItype>SubProcess</PItype>
        <PIfrom>6.1</PIfrom>
        <PIas>1536-1-0</PIas>
        <PO />
      </PI>
      <PI>
        <PIqid>8</PIqid>
        <PIpid>450</PIpid>
        <PIpx>461</PIpx>
        <PIpy>-43</PIpy>
        <PItext>What is the security level on the CPE Management page?</PItext>
        <PItype>Question</PItype>
        <PIfrom>6.2,5.2</PIfrom>
        <PIto>8.4,8.3,8.2,8.1</PIto>
        <PIc>279</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>-112</POpx>
          <POpy>89</POpy>
          <POtext>Block All</POtext>
          <POto>9</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>Standard</POtext>
          <POto>11</POto>
        </PO>
        <PO>
          <POoid>3</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>83</POpx>
          <POpy>116</POpy>
          <POtext>Disabled</POtext>
          <POto>12</POto>
        </PO>
        <PO>
          <POoid>4</POoid>
          <POqid>8</POqid>
          <popid>450</popid>
          <POpx>-14</POpx>
          <POpy>94</POpy>
          <POtext>User Defined</POtext>
          <POto>12</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>9</PIqid>
        <PIpid>450</PIpid>
        <PIpx>237</PIpx>
        <PIpy>76</PIpy>
        <PItext>Change the security level to Standard. Does this resolve the customers issue?</PItext>
        <PItype>Question</PItype>
        <PIfrom>8.1</PIfrom>
        <PIto>9.2,9.1</PIto>
        <PIc>280</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>9</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>10</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>9</POqid>
          <popid>450</popid>
          <POpx>69</POpx>
          <POpy>73</POpy>
          <POtext>No</POtext>
          <POto>11</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>10</PIqid>
        <PIpid>450</PIpid>
        <PIpx>158</PIpx>
        <PIpy>185</PIpy>
        <PItext>Issue Resolved</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>9.1</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>122</PIe3>
        <PO />
      </PI>
      <PI>
        <PIqid>11</PIqid>
        <PIpid>450</PIpid>
        <PIpx>821</PIpx>
        <PIpy>144</PIpy>
        <PItext>Change the security level to Disabled. Is the customer able to browse the internet?</PItext>
        <PItype>Question</PItype>
        <PIfrom>9.2,8.2</PIfrom>
        <PIto>11.2,11.1</PIto>
        <PIc>281</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>11</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>12</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>11</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>14</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>12</PIqid>
        <PIpid>450</PIpid>
        <PIpx>474</PIpx>
        <PIpy>186</PIpy>
        <PItext>Change the security level to Standard. Is the customer able to browse the internet now?</PItext>
        <PItype>Question</PItype>
        <PIfrom>11.1,8.3,8.4</PIfrom>
        <PIto>12.2,12.1</PIto>
        <PIc>283</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>12</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>13</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>12</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>14</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>13</PIqid>
        <PIpid>450</PIpid>
        <PIpx>322</PIpx>
        <PIpy>278</PIpy>
        <PItext>Issue Resolved</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>12.1</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>123</PIe3>
        <PO />
      </PI>
      <PI>
        <PIqid>14</PIqid>
        <PIpid>450</PIpid>
        <PIpx>645</PIpx>
        <PIpy>327</PIpy>
        <PItext>Ask the customer to perform a master reset. Does this resolve their issue?</PItext>
        <PItype>Question</PItype>
        <PIfrom>12.2,11.2</PIfrom>
        <PIto>14.2,14.1</PIto>
        <PIc>282</PIc>
        <PO>
          <POoid>1</POoid>
          <POqid>14</POqid>
          <popid>450</popid>
          <POpx>-50</POpx>
          <POpy>70</POpy>
          <POtext>Yes</POtext>
          <POto>16</POto>
        </PO>
        <PO>
          <POoid>2</POoid>
          <POqid>14</POqid>
          <popid>450</popid>
          <POpx>50</POpx>
          <POpy>70</POpy>
          <POtext>No</POtext>
          <POto>15</POto>
        </PO>
      </PI>
      <PI>
        <PIqid>15</PIqid>
        <PIpid>450</PIpid>
        <PIpx>768</PIpx>
        <PIpy>435</PIpy>
        <PItext>Faulty CPE</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>14.2</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>124</PIe3>
        <PO />
      </PI>
      <PI>
        <PIqid>16</PIqid>
        <PIpid>450</PIpid>
        <PIpx>479</PIpx>
        <PIpy>420</PIpy>
        <PItext>Issue Resolved</PItext>
        <PItype>ExitPoint</PItype>
        <PIfrom>14.1</PIfrom>
        <PIe1>1</PIe1>
        <PIe2>6</PIe2>
        <PIe3>123</PIe3>
        <PO />
      </PI>
    </P>Thanks in advance.

  • Search help in selection screens for interactive report

    A search help can only be assigned to DB table.
    So my doubt is can it also be used for seletion screens created for an interactive report?
    If yes what is the procedure.. Please give me one example at least...
    waiting for your valuable suggestions.....
    Thanks,
    regards,
    Chinmay

    Hi Chinmay,
    I suppose your requirement is to give search help to selection screen elements.
    Here is the code.
    REPORT  ZSHAIL_F4HELP                           .
    parameters: name(10) type c .
    TYPES: BEGIN OF VALUES,
             CARRID TYPE SPFLI-CARRID,
             CONNID TYPE SPFLI-CONNID,
           END OF VALUES.
    dATA: PROGNAME LIKE SY-REPID,
          DYNNUM   LIKE SY-DYNNR,
          DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
          FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
          VALUES_TAB TYPE TABLE OF VALUES.
    at selection-screen on value-request for name.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
      EXPORTING
        tabname                   = 'DEMOF4HELP'
        fieldname                 = 'CARRIER1'
      SEARCHHELP                = ' '
      SHLPPARAM                 = ' '
       DYNPPROG                  = PROGNAME
       DYNPNR                    = DYNNUM
       DYNPROFIELD               = 'CARRIER'
      STEPL                     = 0
      VALUE                     = ' '
      MULTIPLE_CHOICE           = ' '
      DISPLAY                   = ' '
      SUPPRESS_RECORDLIST       = ' '
      CALLBACK_PROGRAM          = ' '
      CALLBACK_FORM             = ' '
      SELECTION_SCREEN          = ' '
    IMPORTING
      USER_RESET                =
    TABLES
      RETURN_TAB                =
    EXCEPTIONS
       FIELD_NOT_FOUND           = 1
       NO_HELP_FOR_FIELD         = 2
       INCONSISTENT_HELP         = 3
       NO_VALUES_FOUND           = 4
       OTHERS                    = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    AT SELECTION-SCREEN OUTPUT.
    PROGNAME = SY-REPID.
      DYNNUM   = SY-DYNNR.
      CLEAR: FIELD_VALUE, DYNPRO_VALUES.
      FIELD_VALUE-FIELDNAME = 'CARRIER'.
      APPEND FIELD_VALUE TO DYNPRO_VALUES.
    I hope your query is solved.
    If so,please award points.
    Regards,
    Sylendra.

  • Need a query help

    hii
    i need a query help
    i have two tables
    the 1st table will look like this
    associate id weekid no.of. hours
    4000 810 40
    4000 820 30
    4000 830 60
    4000 840 70
    2nd table will look like this
    associate id weekid no.of.hours
    4000 810 40
    4000 820 70
    4000 830 130
    4000 840 200
    so when i subtract the last two records frm each other in the second table the value should be equal to the no.of.hours in the first table.. for example
    the query shud consider the last record and one before the last record and the difference between two records shud be equal to the value in the 1st table
    for example
    consider week id 830 and 840
    in second table 830=130
    840=200
    when u subtraced both values the difference shud be equal to value in the 1st table for tht week id
    1 ---->>>> 840 - 830
    =200 - 130
    =70
    in first table 840 has 70 hrs
    like this it shud check with all records and it shud return only the records which are not equal
    regards
    srikanth

    This..?
    sql>select * from t1;
    A_ID W_ID HRS
    4000  810  40 
    4000  820  30 
    4000  830  60 
    4000  840  70 
    4000  850  80 
    sql>select * from t2;
    A_ID W_ID HRS 
    4000  810  40 
    4000  820  70 
    4000  830  130 
    4000  840  200 
    4000  850  260 
    sql>
    select a_id,w_id,hrs,sum_hrs
    from(
    select t1.a_id a_id,t1.w_id w_id,t1.hrs hrs,t2.hrs sum_hrs,
           t2.hrs - nvl(lag(t2.hrs)  over(order by t1.w_id),0) diff
    from t1,t2
    where t1.w_id = t2.w_id)
    where diff != hrs;
    A_ID W_ID HRS SUM_HRS 
    4000  850  80  260                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • PUT OWN HELP IN SELECT-OPTIONS ( REPORTS)

    HOW CAN I USE MY OWN QUERY HELP IN SELCT-OPTIONS F4 HELP

    Hi,
    Check this sample code and reward points if it helps.
    tables kna1.
    data:
    begin of t_values occurs 2,
    value like kna1-begru,
    end of t_values,
    t_return like ddshretval occurs 0 with header line.
    select-options s_begru for kna1-begru.
    at selection-screen on value-request for s_begru-low.
    refresh t_values.
    t_values = 'PAR*'.
    append t_values.
    t_values = 'UGG'.
    append t_values.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
    retfield = 'BEGRU'
    value_org = 'S'
    tables
    value_tab = t_values
    return_tab = t_return
    exceptions
    parameter_error = 1
    no_values_found = 2
    others = 3.
    if sy-subrc = 0.
    read table t_return index 1.
    s_begru-low = t_return-fieldval.
    endif.

  • Union All query help

    Hi,
    I have a union all query like this :
    select a.prod_id,count(a.app_id) as noofapplications from enrollment a,attest b
    where a.e_id=b.e_id group by a.prod_id
    union all
    select a.prod_id,count(a.app_id) as noofapplications from data_feed x,prod_feed y
    where x.agent_num=y.prod_id group by y.prod_id
    I get the results something like this :
    prod_id noofapplications
    x1824787 2
    y397458 4
    y397458 3
    r457868 3
    i876247 6
    In below results y397458 is showing twice since it results from both the queries .But i want a single result like this :
    prod_id noofapplications
    x1824787 2
    y397458 7
    r457868 3
    i876247 6
    For y397458 it should add 4+3 and the result should be displayed one time only .
    Please help ..
    Thanks in Advance

    Slightly reorder your query text:
    select prod_id,count(app_id) as noofapplications
    from
    select a.prod_id,a.app_id
    from enrollment a,attest b
    where a.e_id=b.e_id
    union all
    select a.prod_id,a.app_id
    from data_feed x,prod_feed y
    where x.agent_num=y.prod_id
    group by prod_id
    /

  • Query help - ORA-01403

    Hello,
    I have a query region which is returning ORA-01403. I've looked online for help and found that the error occurs when you do a SELECT INTO and nothing is returned.
    The query works if I don't do a SELECT INTO -- just a regular select outside of a PL/SQL program works. What am I doing wrong?
    select count(*) INTO TOTAL_COUNT
    from tbl_items, lookup_items, lookup_headings
    where tbl_items.item_id = lookup_items.item_id
    and lookup_items.heading_id = lookup_headings.heading_id
    and tbl_items.sector_id = htmldb_util.get_session_state('SL_SECTOR')
    and lookup_items.heading_id = 1
    and lookup_headings.section_id = htmldb_util.get_session_state('SL_SECTION');
    Thanks,
    Nora

    Nora,
    You don't need your INTO.
    If all you want to do is create a report region which displays the result of your query (and in this case, the count of the rows between your joined tables), the reporting engine of Application Express will automagically take your query, describe your select clause, and format it for you in your report.
    You would use INTO if you wanted to stuff the result into some variable. But you don't want to do that in this case.
    Joel

  • A sum and case query help

    I need help please with the following query.
    I have a table that contains a currency, voucher, start_date and a value.
    Data in the tables looks like this:
    GB, 31/05/2010, A, 100
    GB, 31/05/2010, B, 250
    GB, 31/05/2010, A, 72
    GB, 12/12/2009, A, 1000
    GB, 12/12/2009, B, 72
    LX, 12/05/2010, A, 90
    This is where it gets complicated, I need to show the total(SUM) value when the start_date < 60 days from sysdate and also when the start_date > 61 days AND only if the voucher = A and partioned by the currency.
    So, in other words I need my results like this.
    GB, 31/05/2010, A, 100, *172, 0*
    GB, 31/05/2010, B, 250, *0, 0*
    GB, 31/05/2010, A, 72, *172, 0*
    GB, 12/12/2009, A, 1000, *0, 1000*
    GB, 12/12/2009, B, 72, *0, 0*
    LX, 12/05/2010, A, 90, *90, 0*
    The bold columns are what I need, one called less_than and one more_than.
    A big big thank you and any advice I appreciate.
    S

    Please make a habit of posting sample data we can work with right away by using CREATE TABLE and INSERT INTO statements, or use the WITH clause as shown below:
    SQL> with t as ( -- generating sample data:
      2  select 'GB' currency, to_date('31/05/2010', 'dd/mm/yyyy') start_date, 'A' voucher, 100 value from dual union
      3  select 'GB', to_date('31/05/2010', 'dd/mm/yyyy'), 'B', 250 from dual union
      4  select 'GB', to_date('31/05/2010', 'dd/mm/yyyy'), 'A', 72 from dual union
      5  select 'GB', to_date('12/12/2009', 'dd/mm/yyyy'), 'A', 1000 from dual union
      6  select 'GB', to_date('12/12/2009', 'dd/mm/yyyy'), 'B', 72 from dual union
      7  select 'LX', to_date('12/05/2010', 'dd/mm/yyyy'), 'A', 90 from dual
      8  )
      9  --
    10  -- actual query:
    11  --
    12  select currency
    13  ,      start_date
    14  ,      voucher
    15  ,      value
    16  ,      sum(case
    17               when  trunc(sysdate-start_date)< 60
    18               and  voucher = 'A'
    19               then value
    20               else 0
    21             end) over (partition by currency, voucher, start_date) sum_val1
    22  ,      sum(case
    23               when trunc(sysdate-start_date)> 61
    24               and  voucher = 'A'
    25               then value
    26               else 0
    27             end) over (partition by currency, voucher, start_date) sum_val2
    28  from   t;
    CU START_DAT V      VALUE   SUM_VAL1   SUM_VAL2
    GB 12-DEC-09 A       1000          0       1000
    GB 31-MAY-10 A         72        172          0
    GB 31-MAY-10 A        100        172          0
    GB 12-DEC-09 B         72          0          0
    GB 31-MAY-10 B        250          0          0
    LX 12-MAY-10 A         90         90          0
    6 rows selected.

Maybe you are looking for

  • Why do all IOS upgrades fail from my MBP?

    This isn't the most critical post in the world (I have work around available)... I have not been able to simply update any IOS device from my MBP, I always have the same problem the update hangs mid stream (after the IOS device reboots, and the new I

  • Display won't go black... (energy saver)

    Driving me crazy. I had it set to go dark (the display) after 5 minutes and changed it because I was watching something and now I cannot get the settings to function as they did before/ Any ideas?

  • Messages getting stuck in QRFC Queue

    Hi, Today I noticed that a message had gotten stuck with the status "Sheduled for Outbound Processing" (scenario IDOC->XI->File), XI 3.0 SP11. This in turn had the effect that the whole QRFC queue got stuck, and all following messages got stuck with

  • Microphone Error, anything to

    Hey folks I don't know if it is possible to fixs this, or if anyone is going to help me. But i have now had this problem in a year, and now im pretty fed up so i have lately been posting on every board to find someone who might could help. Anyways, t

  • Adobe Acrobat Print Preview not supported

    I have Adobe Acrobat 8.2.0 and have been having this issue (not really a problem but it bugs me) where when I go to print a PDF and click on preview before sending the document to the printer I always get this message pop up that says "Preview is not