Help for query, calculate the cumulative totals

Hello

I have a data_set table in which we have the amounts of income each month to the other. I want to update at the same table to fill the cumulative total for the current month + total cumulative months income. Here are examples of data.

I use 10.2.0.1.0 (10g) and you want to write an update statement to update the fields.
with data_Set as(
select '201001' month, '1000' income_amt, '1000' net_income_amt, null cumulative_income_Amt, null cumulative_net_income_amt from dual union all
select '201002' month, '1100' income_amt, '1000' net_income_amt,null,null from dual union all
select '201003' month, '1200' income_amt, '1000' net_income_amt,null,null from dual
) select * from data_Set
Write a statement of update for the table looks like in below
with data_set as (
select '201001' month, '1000' income_amt, 1000  cumulative_income_amt, '1000' net_income_amt, 1000 cumulative_net_income_amt from dual union all
select '201002' month, '1100' , 2100,   '1000' , 2000 from dual union all
select '201003' month, '1200' , 3300,   '1000' , 3000 from dual
) select * from data_set
Published by: user527060 on October 29, 2010 12:03

Published by: user527060 on October 29, 2010 12:04
/* Formatted on 10/29/2010 3:18:42 PM (QP5 v5.149.1003.31008) */
WITH data_Set AS (SELECT '201001' month,
                         '1000' income_amt,
                         '1000' net_income_amt,
                         NULL cumulative_income_Amt,
                         NULL cumulative_net_income_amt
                    FROM DUAL
                  UNION ALL
                  SELECT '201002' month,
                         '1100' income_amt,
                         '1000' net_income_amt,
                         NULL,
                         NULL
                    FROM DUAL
                  UNION ALL
                  SELECT '201003' month,
                         '1200' income_amt,
                         '1000' net_income_amt,
                         NULL,
                         NULL
                    FROM DUAL)
SELECT month,
       income_amt,
       SUM (income_amt) OVER (ORDER BY month) cumulative_income_amt,
       net_income_amt,
       SUM (net_income_amt) OVER (ORDER BY month) cumulative_net_income_amt
  FROM data_Set;
MONTH,INCOME_AMT,CUMULATIVE_INCOME_AMT,NET_INCOME_AMT,CUMULATIVE_NET_INCOME_AMT
201001,1000,1000,1000,1000
201002,1100,2100,1000,2000
201003,1200,3300,1000,3000

Sorry just missed originally the part where you wanted to put here, it's with the merger of

/* Formatted on 10/29/2010 3:26:26 PM (QP5 v5.149.1003.31008) */
MERGE INTO data_set a
     USING (SELECT month,
                   income_amt,
                   SUM (income_amt) OVER (ORDER BY month)
                      cumulative_income_amt,
                   net_income_amt,
                   SUM (net_income_amt) OVER (ORDER BY month)
                      cumulative_net_income_amt
              FROM data_Set) b
        ON (a.month = b.month AND a.income_amt = b.income_amt and a.net_income_amt = b.net_income_amt)
WHEN MATCHED
THEN
   UPDATE SET
      a.cumalative_income_amt = b.cumulative_income_amt,
      a.cumulative_net_income_amt = b.cumulative_net_income_amt

Published by: pollywog on October 29, 2010 15:26

Published by: pollywog on October 29, 2010 15:29

Tags: Database

Similar Questions

  • Help for problems with the functionality of Capture from Adobe

    Hello

    I recently installed Adobe Capture on my Smartphone (Android device) and the app is very cool.  However, after a few weeks of use, the software stops working.  I uninstalled the software and reinstalled to see if that would help solve the problem.  Unfortunately, it has not solved the problem.  Adobe does not provide an over-the-phone technical support for this product, so I hope someone here can help.

    Recreation of question:

    When you start the application, there are four 4 functions:

    1. Colors
    2. Forms
    3. Brushes
    4. Looks like

    In the lower right corner of the screen, we see a sign '+', which, depending on which function you select, invite the user to 1) select from the cloud or 3) take a new photo 2) select a picture in the camera.  When you select an option, Adobe Capture executes the designated function and the State final changes / outputs on the picture are visible.

    However, when you try to accept or to save changes / outputs, the screen seems to hang up and return to the initial splash screen.

    Can provide you any assistance?

    Thank you!

    Jerry

    Hi Jerry,

    I'm really sorry that capture does not work as it should. This is a known issue in the app and the team is working on a beta version with a fix. I hope that it will be available before the end of the week, but I'm not totally sure of the timeline.

    I know we'll get it on Adobe Android Apps - community - Google +, then join this page and you will be informed as soon as it is available.

    A couple of other things:

    It's an incredible description of the problem you are experiencing. Thank you very much for going into details so. It makes a huge difference when engineers are trying to understand what is happening.

    If please post here or contact us through the app (tap on the draw icon, then give us Feedback) whenever you need help. Sometimes on the weekends, I'm a little slow, but during the week, I'm trying to reach people as quickly as possible.

    I hope this helps.

    Sue.

  • Need help for query flat_file type clobdata oracle table data.

    Hi Sir,

    I need help to query oracle table flat file data having given clob type.
    Oracle Version:
    
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    
    
    Source table
    
      CREATE TABLE order_details 
       (     QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         CHAR_DATA CLOB, 
         OPTIMISTIC_LOCK_KEY NUMBER(20,0)
       ) 
    COLUMN FOR CHAR_DATA FLAT_FILE
    EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT
    EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT
    EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT
    EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT
    EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT
    EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT
    EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT
    EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT
    EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT
    EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT
    EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
    EXPECTED RESULTS:
    AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY             SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY        
    EU          6067AT       AT10                 000000402004       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             
    EU          6068AT       AT11                 000000402005       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             

    Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
    Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something as

    select table_row,
           level clob_row,
           regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line
      from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row,
                   char_data
              from order_details
           )
     connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null
            and prior char_data = char_data
            and prior table_row = table_row
            and prior sys_guid() is not null
    

    to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.

    Concerning

    Etbin

    Edited by: Etbin on 3.2.2013 09:01

    .. .but I m connected to do things according to the instructions, I can't do something.

    Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
    rp0428 post - something to remember.

  • Context-sensitive help for objects on the tabs (bug?)

    If a command or the indicator is on a tab, the context-sensitive help for that apparently no longer works. It's particularly embarrassing for clusters of complicated example.

    Is there a workaround I'm mising?

    Example: This is the context for a cluster (A) and for the same cluster help when placed on a tab of the control (B). Case B is obviously completely useless.

    Hi Altenbach,

    It is true that it is not fixed for 2009.  I checked the condition of the CAR and it does not just he makes to the 2009 version.  It is always open and it looks like they still want to fix in the future, but no guarantee on which version.

  • I need help for activation of the real administrator account.

    I have a problem with Adobe reader 9 standard, Adobe customer service asked the unhide real administrator account before you can continue to help me.

    I need help for that.

    http://www.Vistax64.com/tutorials/67567-administrator-account.html

    http://www.howtogeek.com/HOWTO/Windows-Vista/enable-the-hidden-administrator-account-on-Windows-Vista/

    Read the above info.

    See you soon. Mick Murphy - Microsoft partner

  • Help for query

    Sorry I use a new job for my need.

    Having this data sample

    How can I spread over 4 rows in total of 36.15.
    WITH data AS
     (
    SELECT 12011 as id,  10 q1, '4,25'  p1
    FROM   dual
    union all
    SELECT 12011 as id, 8 q1, '4,25'  p1
    FROM   dual
    union all
    SELECT 12011 as id, 10 q1, '4,25'  p1
    FROM   dual
    union all
    SELECT 12011 as id,10 q1, '4,25'  p1
    FROM   dual
     )
    -- select sum(tic1) from (
    SELECT  ESA.*,
               CASE
                     WHEN T_IMPORTO_ESAMI   <= MAX_T THEN q1 * p1
                     WHEN T_IMPORTO_ESAMI   >  MAX_T THEN ROUND (  ( (MAX_T *  (p1*q1) ) / T_IMPORTO_ESAMI) , 2)
                  END tic1
    FROM
    
     (
    SELECT ALL EP.*,36.15 MAX_T,
             SUM(ep.q1 * ep.p1) over (partition by EP.id ) as T_IMPORTO_ESAMI
       FROM  data EP
       ) ESA
       --);
    ID        Q1     P1        MAX_T        T_IMPORTO_ESAMI     TIC1
    12011     10     4,25     36,15        161,5                 9,51
    12011     10     4,25     36,15        161,5                 9,51
    12011     10     4,25     36,15        161,5                 9,51
    12011     8     4,25     36,15        161,5                 7,61 --> 7,62 right value
       
    How can I spread over the four total lines of 36.15.
    in other words, in the fourth row (last line), the TIC1 column should be the difference between the total amount (36.15) and
    the sum of the previous lines = 9.51 + 9.51 + 9.51 = 28.53, in other words, must be 36.15 - 28.53 = 7.62

    Thank you
    SQL> WITH data AS
      2  ( SELECT 12011 as id,  10 q1, 4.25  p1
      3    FROM   dual
      4    union all
      5    SELECT 12011 as id, 8 q1, 4.25  p1
      6    FROM   dual
      7    union all
      8    SELECT 12011 as id, 10 q1, 4.25  p1
      9    FROM   dual
     10    union all
     11    SELECT 12011 as id,10 q1, 4.25  p1
     12    FROM   dual
     13  )
     14  , esa as
     15  ( select id
     16         , q1
     17         , p1
     18         , ratio_to_report(p1*q1) over (partition by id) rtr
     19         , sum(p1*q1) over (partition by id) t_importo_esami
     20         , count(*) over (partition by id) cnt
     21         , row_number() over (partition by id order by null) row_nr
     22         , 36.15 max_t
     23      from data
     24  )
     25  select id
     26       , q1
     27       , p1
     28       , max_t
     29       , t_importo_esami
     30       , case
     31         when t_importo_esami <= max_t then
     32           p1 * q1
     33         when row_nr < cnt then
     34           round(rtr * max_t,2)
     35         else
     36           max_t - sum(round(rtr * max_t,2)) over (partition by id order by row_nr rows between unbounded preceding and 1 preceding)
     37         end tic1
     38    from esa
     39   order by id
     40       , row_nr
     41  /
    
            ID         Q1         P1      MAX_T T_IMPORTO_ESAMI       TIC1
    ---------- ---------- ---------- ---------- --------------- ----------
         12011         10       4.25      36.15           161.5       9.51
         12011          8       4.25      36.15           161.5       7.61
         12011         10       4.25      36.15           161.5       9.51
         12011         10       4.25      36.15           161.5       9.52
    
    4 rows selected.
    

    Kind regards
    Rob.

  • I need help for query AVG

    I need help with a simple query in an ORACLE database. I tried a lot of things that I found on the internet, but none of them worked for me.

    The following query retrieves four lines:

    SELECT sampled_date AS VALUE1, VALUE2 AS result, 0 as value3

    Of asw_lab

    WHERE template_result = 'A' AND analysis = 'B' AND ROWNUM < 5

    ORDER BY sampled_date DESC;

    I would like to calculate a moving average of the last four values with the date of the sample of the last line.

    For example, I have this result for the query above:

    Value1 value2 value3

    01/04/14-16:00 1 0

    01/04/14 15:00 2 0

    01/04/14 14:00 3 0

    01/04/14 13:00 4 0

    I want to extract the below my average/query calculation result:

    Value1 value2 value3

    01/04/14-16:00 2.5 0

    Can you help me create a request to that effect?

    Thank you

    Maybe it's

    Select max (VALUE1) VALUE1, VALUE2 avg (VALUE2), avg (VALUE3) value3

    Of

    (

    SELECT sampled_date AS VALUE1, VALUE2 AS result, 0 as value3

    Of asw_lab

    WHERE template_result = 'A' AND analysis = 'B' AND ROWNUM<>

    )

  • Need help for query joining views

    Hi all

    I need to run a query that joins a number of tables with multiple instances of the same view.  For example, a view named MY_VALUES, is an array of key / value resembles the following:

    Application_ID Attirbute_Description value

    1 1 000 basic benefit

    1 multiplier 1 0.5

    1 Multiplier_2 1.2

    1 total profit 1,115

    2 1 025 basic benefit

    2 multiplier 1 0,268

    2 Multiplier_2 1.3

    Total profit 2 1.4500

    Say I want a query that selects basic earnings and a multiplier 1 for Application ID 1, as well as, other information from a table called APPLICATION that has a relationship to display pk - fk. I would do the following:

    Select the application. Name, mv1.value, mv2.value

    from dbo. App APPLICATION, dbo. MY_VALUES mv1, dbo. Mv2 MY_VALUES

    where app.id = mv1.application_id and mv1.attribute_description = "Basic benefits"

    and app.id = mv2.application and mv2.attribute_description = id 'multiplier 1'.

    and app.id = 1

    My actual query is similar to this. However, I have many other attributes of the notice I need to select, which requires that the view be attached to several times. After 16 these joins, the request is fine. After 17, however, the query runs always, never return a result within 45 minutes I have let it run.

    Is there a better way to write such a request or an indicator of optimization that would be useful here?

    Any help is greatly appreciated.

    ....

    For this type of application, it is often best to extract multiple lines in a single request on the view and their pivot in the output.

    For example

    Select the application. Name

    , max (CASE when mv.attribute_description = "Core service" then mv.value any other purpose) BaseBenefit

    , max (CASE when mv.attribute_description = 'Multiplier 1' then mv.value any other purpose) Multiplier1

    , max (CASE when mv.attribute_description = 'Multiplier 2' then mv.value any other purpose) Multiplier2

    , max (CASE when mv.attribute_description = 'Multiplier 3' then mv.value end to another null) Multiplier3

    from dbo. App APPLICATION, dbo. MY_VALUES mv

    where app.id = mv1.application_id

    and mv.attribute_description IN ('benefits of home', 'multiplier 'multiplier 'multiplier 3' 2' 1')

    and app.id = 1

    This runs often much better than several joins to the table for the view or the value of the attribute.

  • need help for query, accumulative sum

    We have a room with two doors, one of which is installed with biometric devices

    so total devices are 4-two IN and two out

    a table we where these enteries are saved:

    name, record type, id,

    a, 1, June 4, 2015 09:00:13 ', '1 - IN'

    "a, 1, June 4, 2015 09:10:13 ', ' 1 - OUT"

    a, 1, June 4, 2015 09:30:13 ', '2 - IN'

    "a, 1, June 4, 2015 11:00:13 ', ' 1 - OUT"

    create table DRC (varchar2 (40) name, identification number, registration timestamp, type varchar2 (10));

    insert into rec values ('a', 1, June 4, 2015 09:00:13 ', '1 - IN');

    insert into rec values ('a', 1, 4 June 2015 09:10:13 ', ' 1 - OUT');

    insert into rec values ('a', 1, June 4, 2015 09:30:13 ', '2 - IN');

    insert into rec values ('a', 1, 4 June 2015 11:00:13 ', ' 1 - OUT');

    I am designing the query result as below:

    power required

    identification, intype intimate outtime outtype

    a, 1, 04/06/2015-09:00:13 1 - IN 04/06/2015-09:10:13 1-OUT

    a, 1, 04/06/2015-09:30:13 IN. 2-04/06/2015 11:00:13 1-OUT

    Displaying data with name = 'b' (adjusted for hh24) added that he does not understand the OP

    with

    REC as

    (select 'a' name, 1 id, the to_date (June 4, 2015 09:00:13 ',' dd-mm-yyyy hh24:mi:ss') (timestamp,"1-IN' type of union double all the)

    Select 'a', 1, to_date (June 4, 2015 09:10:13 ',' dd-mm-yyyy hh24:mi:ss'), '1 - OUT' of all the double union

    Select 'a', 1, to_date (June 4, 2015 09:30:13 ',' dd-mm-yyyy hh24:mi:ss'), '2 - IN' of all the double union

    Select 'a', 1, to_date (June 4, 2015 11:00:13 ',' dd-mm-yyyy hh24:mi:ss'), '1 - OUT' of all the double union

    Select 'b', 2, to_date (June 4, 2015 11:30:13 ',' dd-mm-yyyy hh24:mi:ss'), '2 - IN' of all the double union

    Select 'b', 2, to_date (June 4, 2015 14:00:13 ',' dd-mm-yyyy hh24:mi:ss'), '2 - OUT' Union double all the

    Select 'b', 2, to_date (June 4, 2015 14:30:13 ',' dd-mm-yyyy hh24:mi:ss'), '2 - IN' of all the double union

    Select 'b', 2, to_date (June 4, 2015 18:00:13 ',' dd-mm-yyyy hh24:mi:ss'),'1 - OUT "of the double

    )

    SELECT name, id, to_char (timestamp, 'dd-mm-yyyy hh24:mi:ss') in_time, typ in_type, to_char (outtime, 'dd-mm-yyyy hh24:mi:ss') out_time, outtype out_type

    (select name, id, timestamp, type,

    cases where instr(typ,'IN') > 0 then lead (timestamp) on the end (partition by name, by order of the identification by timestamp) outtime.

    cases where instr(typ,'IN') > 0 then lead (typ) on the end (partition by name, by order of the identification by timestamp) outtype

    REC

    )

    where coalesce (to_char (outtime, 'yyyymmddhh24miss'), outtype) is not null

    order by name, id, in_time

    NAME ID IN_TIME IN_TYPE OUT_TIME OUT_TYPE
    one 1 04/06/2015-09:00:13 1. 04/06/2015-09:10:13 1-OUT
    one 1 09:30:13 04/06/2015 2. IN 04/06/2015 11:00:13 1-OUT
    b 2 04/06/2015 11:30:13 2. IN 04/06/2015 14:00:13 2 OUTPUTS
    b 2 14:30:13 04/06/2015 2. IN 04/06/2015-18:00:13 1-OUT
  • Satellite A500-19U - need help for games and the AC adapter / CC

    Heys guys.

    I got my new Satellite A500-19U and install games on it like COD4, assassin Creed, Batman, Mafia 2 .and much

    All of these games crashes & freezes after screen black or white, 3-5 Min & gimmea and this happenWHILE CONNECT the AC ADAPTER to charge the battery. While using the battery just fine, except some crashes after a long period of palying. Some time, he said (the display driver not responding) & sometimes the screen black or white. The only way to recover the laptop is ALT + CTRL + DELETE and wait until the game to recover & cases laptop stop responding & the only way is to hard reboot.

    The only one that works such fine bit is Battlefield Bad Company 2. Then I change the DirectX (setting.ini) of car in DirectX9.

    SP please any help on this matter. I think it's a video driver or a Windows 7 problem. And the specifications are:

    Processor: Inter Core 2 Due P7450 2.13 GHz
    RAM: 4 GB DDR3
    VGA: Nvidia Geforce G210M with the driver from the Toshiba Site has also tested the latest driver from Nvidia Site Version: 258.96
    OS: Windows 7 64-bit [pre-installed]

    I think that its not big problem for Toshiba co.  :)

    Hi mate

    I think that it is a nuisance driver in most cases not entirely compatible graphics cards drivers are the reason why games dishes t working correctly.

    What to say; I think that the update of the driver is the key
    You will need to find a good driver version
    Toshiba pilot European page you can find the latest drivers published by Toshiba
    But this does not mean that these are the most recent drivers released by nVidia or ATI
    nVidia or ATI drivers are always different

    In order to check the drivers from nVidia page too.
    You can also try the version published on the Web site www.omegadrivers.net or www.laptopvideo2go.com
    But note; These are not tested drivers and use is at your own risk!

  • Help for interpretation explains the release of the plan (dbms_xplan)

    Hi all

    I am trying to familiarize themselves with the reading and interpretation of the output of explain plan command or dbms_xplan, and so I hope someone can help with the output below.

    With the command explain below, means that...

    (a) he began to step 8 and sends all the lines of the loop nested in step 5
    (b) but sends (or think it sends) 1 row in step 5 to step 8
    (c) for each line that is provided in step 5, there will be a search index in step 8 to access the table in step 6
    (d) step 8 gets only (or think it gets) 1 row

    If that means that only 1 row is expected by the optimizer and yet the full table scan must return to 150 000 documents, and table a statistiucs to date, what else would cause the cardinality be far off?
    If she does not mean it will return 1 row, then does that mean?
    ----------------------------------------------------------------------------------------------------------------------
    | Id  | Operation                           | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                    |                                |       |       |   945 (100)|          |
    |   1 |  SORT GROUP BY                      |                                |     1 |   283 |   945   (3)| 00:00:05 |
    |*  2 |   FILTER                            |                                |       |       |            |          |
    |   3 |    NESTED LOOPS                     |                                |       |       |            |          |
    |   4 |     NESTED LOOPS                    |                                |     1 |   283 |   944   (3)| 00:00:05 |
    |   5 |      NESTED LOOPS                   |                                |     1 |   108 |   929   (3)| 00:00:05 |
    |*  6 |       MAT_VIEW ACCESS FULL          | DEMOGRAPHICS_MV                |     1 |    97 |   927   (3)| 00:00:05 |
    |*  7 |       MAT_VIEW ACCESS BY INDEX ROWID| NAMES_MV                       |     1 |    11 |     2   (0)| 00:00:01 |
    |*  8 |        INDEX RANGE SCAN             | ORG_MV_IDX1                    |     1 |       |     1   (0)| 00:00:01 |
    |*  9 |      INDEX RANGE SCAN               | PAY_IDX8                       |   252 |       |     4   (0)| 00:00:01 |
    |* 10 |     TABLE ACCESS BY INDEX ROWID     | PAY_ALL                        |     1 |   175 |    15   (0)| 00:00:01 |
    ----------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
          8 - access("ORG_MV"."ORG_ID"="DEMO_MV"."ORG_ID")
    Thanks a lot for your help.

    SQL execution starts at ID = 6 with full scan on DEMOGRAPHICS_MV. This analysis should return 1 row.
    Then, he expects to lead a nested loop to scan via the Index ORG_MV_IDX1 a NAMES_MV once (for 1 line, extracted from DEMOGRAPHICS_MV).
    It then goes to PAY_IDX8 once where he expects to get 252 ROWID.
    Finally, it accesses the table PAY_ALL.

    You should also post the main information because it is very important to understand access and FILTER operations for each operation.

    Hemant K Collette

  • [Help] How to calculate the number in the same columns

    Hi all

    I have a dynamic repeating table, which displays data in the comic book,

    a watch columns numbers lik 20,15,50,50 in each row.

    I want to calculate these numbers and enter total in the total box.

    You will need to perform the calculation within the region of repetition like this:

    ip name line switch mac phone details month value Collected credit p
    Total
  • I need help for C & C The First Decade * Urgent *.

    Hey guys, I have problems with my game. It is not compatible as others, my problem is that I can't run TFD without having the game CD in the disc drive. Any help would be appreciated much: D. Oh and by the way, my laptop specs are:

    Laptop: HP Pavilion dv6000
    Operating system: Windows 7 Ultimate Service Pack 1
    Processor: Intel core 2 Duo CPU T 5750 2.00GHz @ 2.00 GHz
    System type: 32-bit operating system
    Graphics card: I have no idea

    This is due to the protection against piracy (cd check) that the editor has put in place. You could check if there is an update removes that requirement but I doubt, that there is.

  • need help for query

    Hello

    I have a table produced, have two columns and below the sample data and I want to select distinct values in this table on the two columns. Please let me know how can achieve us.

    x                                                                y

    ===                                                       ===

    Sony Erricson ~ Lithion Sony Erricson ~ Lithion ~ 6

    Sony Erricson ~ Lithion Sony Erricson ~ Lithion Essentials ~ 2

    Sony Erricson ~ Lithion Sony Erricson ~ Lithion ~ 6

    Lithion ~ Tmobile Lithion Lithion ~ Tmobile Lithion ~ 6

    Sony Erricson ~ Lithion Sony Erricson ~ Lithion ~ 7

    Sony Erricson ~ Lithion Sony Erricson ~ Lithion ~ 8

    output:

    =====

    x                                                                y

    Sony Erricson ~ Lithion Sony Erricson ~ Lithion ~ 6

    Lithion ~ Tmobile Sony Erricson Lithion ~ Lithion Essentials ~ 2

    NULL the Sony Erricson ~ Lithion ~ 7

    NULL the Sony Erricson ~ Lithion ~ 8

    Help is very appreciated.

    THX in advance

    one of the ways below, if this does not help please share create table statement and the data from the sample as insert the script with desired output

    with data
    as
    (
    select 'Sony Erricson~Lithion' prd1,'Sony Erricson~Lithion~6' sub_prd from dual
    union all
    select 'Sony Erricson~Lithion','Sony Erricson~Lithion Essentials~2'  from dual
    union all
    select 'Sony Erricson~Lithion','Sony Erricson~Lithion~6'  from dual
    union all
    select 'Lithion~Tmobile Lithion','Lithion~Tmobile Lithion~6' from dual
    union all
    select 'Sony Erricson~Lithion','Sony Erricson~Lithion~7' from dual
    union all
    select 'Sony Erricson~Lithion','Sony Erricson~Lithion~8' from dual
    )
    select case when rn > 1 then null else prd1 end prd1,
    sub_prd,
    rn2
    from (
    select prd1, sub_prd, row_number() over(partition by prd1 order by prd1) rn,
    row_number() over(partition by prd1,sub_prd order by prd1,sub_prd) rn2 from data
    )
    where rn2 = 1
    order by prd1
    
  • Help for query for multiple rows as XML mapping

    Greetings:

    I try to use the request for the service of several lines to fill a schema that is not "flat" in the repeating node.

    I have used this service successfully when all elements to be filled are at the same level.

    I hope someone can tell me how to get mappings into the XML Information for the service operation panel.

    I tried ' ATTRIBUTES/appt_req' and various other formats I could think to map to the name of the correct item, but I always get an XML error.

    ACTIVE is the root, and ACTIVATES the repeating node.

    ATTRIBUTES does not extend within the ASSETS.

    I'm including a sample of the pattern I am trying to load, and I can enter data into the level of the ACTIVE/ACTIVE, but I could not apply to items of ASSETS/ASSETS/ATTRIBUTES

    I also have to find a way to treat the Keywords node at any given time.

    Thank you

    Mark

    < ACTIVE >
    < ACTIVE >
    < template_key > tkey1 < / template_key >
    < id > INSTLP0001a < /ID >
    < > 1.2 worm < / worm >
    < ind_status > inactive < / ind_status >
    < last_mod_user > wade01 < / last_mod_user >
    < last_mod_dt > 2010 - 04 - 19 < / last_mod_dt >
    < last_mod_tm > 13:20:00 - 05:00 < / last_mod_tm >
    < flg_activate > 0 < / flg_activate >
    string of < flg_attrib_change > < / flg_attrib_change >
    < ATTRIBUTES >
    < appt_req > 1 < / appt_req >
    < ref_md_req > 1 < / ref_md_req >
    < site > CARDIO < / site >
    < print_appt_card > 1 < / print_appt_card >
    < send_ref_md_lttr > 1 < / send_ref_md_lttr >
    < no_remind_lttr > 1 < / no_remind_lttr >
    < > 612 area_code < / area_code >
    < phone_prefix > 619 < / phone_prefix >
    < dflt_pcc_notes > This is a test for the model 01 v1.2 < / dflt_pcc_notes >
    < flag_direct_prn > < / flag_direct_prn >
    < / ATTRIBUTE >
    < Keyword >
    < KEYWORD >
    v1.2 touches 1 < keyword > < / keyword >
    < / KEYWORD >
    < KEYWORD >
    < keyword > key 2 v1.2 < / keyword >
    < / KEYWORD >
    < KEYWORD >
    v1.2 touches 3 < keyword > < / keyword >
    < / KEYWORD >
    < / Keywords >
    < / CURRENT >
    < / ASSETS >

    TEMPLOAD.JPG

    The alternative would be to use the XSLT service to re - organize the xml as you wish.

    Jasmine

Maybe you are looking for

  • How can I use properties with TestStand

    I guess that's another pretty basic question: -. I use just a step for now to do what I want to do and reprot back after it's done. Finally, I would like to use properties as the current method has considerable drawbacks. Problem is: 'the object' see

  • error code 8E5E03FE

    Windows update will not install updates and gives me error code 8E5E03FE

  • Merging of files in different directories

    How to merge the contents of several directories into a single directory?  Using Vista.  Is it anything other than cut and paste, cut and paste?

  • s5710f

    can I use the AMD Phenom II X 4 965 Black Edition Deneb 3.4 GHz Socket AM3 125 w HDZ965FBGMBOX processor Quad-Core processor in my machine even tho, the power is much higher then in the "processor upgrade info" at the top? It looks like the same ment

  • Service.exe attempts to send many emails to addresses that I never heard talk and an addrees I have no knowledge.

    A few days my computer tried to start sending e-mails ago I knew nothing.I tried to restore the system to an earlier date, but she wouldn't let me.I scanned with the software Malware, Trojan & virus but nothing was found.I also scanned registry softw