How to reduce the time in the query

Hi all

When I run this query, it will take more time to run it... Please suggest me... I added parallael tips... can we add advice to this request
select
/*+ parallel(b, 10)  parallel(a 10) parallel(f, 10) parallel(s 10) */
    (((Category.Customer_Meter_Reading)/(Category.Customer_All_Meter_Reading))*100) as Count_of_customers,           -- % of Customers
    Count(g.Anlage) as Count_Of_Supplypoints,        -- Count of Supply points
    case
        When a.cokey = '1000' then 'Premier Energy' -- Customer Segment
        When a.cokey = '2000' then 'Energy First'
        When a.cokey = '3000' then 'PAYGE'
    end as Customer_Segment,
   
     case
        when nvl(df.SPARTE,'X') = 'X' then 'Dual Fuel'
        else
        case
        when b.SPARTE ='01' then 'Electricity'      --Product
        when b.SPARTE ='02' then 'Gas'
        end
    end Product,
   
    case
        when b.fdgrp = '0000000001' then 'Direct Debit - QVDD'  --PayMethod
        when b.fdgrp = '0000000002' then 'Direct Debit - CPS'
        when b.fdgrp = '0000000003' then 'Standing Order'
        when b.fdgrp = '0000000004' then 'CPS - APT'
        when b.fdgrp = '0000000005' then 'Magnetic Card'
        when b.fdgrp = '0000000006' then 'CPS QEP'
        when b.fdgrp = '0000000007' then 'Cash / Cheque'
        when b.fdgrp = '0000000008' then 'Fuel Direct'
        when b.fdgrp = '0000000009' then 'Prepayment'
        when b.fdgrp = '0000000010' then 'Pending Fuel Direct'
        else 'Other'
    end as Paymethod,
   
    case
         when f.TARIFART='E-CAP4' then 'E-CAP4 - Price Protection April 2009'
         when f.TARIFART='E-CAP5' then 'E-CAP5 - Price Promise'
         when f.TARIFART='E-FIX2' then 'E-FIX2 - Price Protection 2010'
         when f.TARIFART='E-FIX4' then 'E-FIX4 - Click Energy'
         when f.TARIFART='E-FIX5' then 'E-FIX5 - Price Protection December 2009'
         when f.TARIFART='E-FIX13' then 'E-FIX13 - Fix & Fall'
         when f.TARIFART='E-FIX12' then 'E-FIX12 - Fix & Fall 2'
         when f.TARIFART='E-FIX10' then 'E-FIX10 - Click Energy 2'
         when f.TARIFART='E-FIX14' then 'E-FIX14 - Essentials (Social Tariff)'
         when f.TARIFART='E-FIX6' then 'E-FIX6 - Discounted Energy'
         when f.TARIFART='E-FIX16' then 'E-FIX16 - Click Energy 3'
         when f.TARIFART='E-FIX20' then 'E-FIX20 - Market Tracker'
         when f.TARIFART='E-FIX17' then 'E-FIX17 - Future Energy'
         when f.TARIFART='E-FIX18' then 'E-FIX18 - Zero Carbon'
         when f.TARIFART='E-FIX21' then 'E-FIX21 - Click Energy 4'
         when f.TARIFART='E-FIX23' then 'E-FIX23 - Price Protection February 2009'
         when f.TARIFART='E-FIX22' then 'E-FIX22 - Click Energy 5'
         when f.TARIFART='E-FIX19' then 'E-FIX19 - 10% Discount Tracker'
         when f.TARIFART='E-FIX11' then 'E-FIX11 - Price Guarantee 2009'
         when f.TARIFART='E-FIX24' then 'E-FIX24 - Price Guarantee 2009 Green Elec'
         when f.TARIFART='G-CAP1' then 'G-CAP1 - Price Protection April 2009'
         when f.TARIFART='G-CAP2' then 'G-CAP2 - Price Promise'
         when f.TARIFART='G-FIX2' then 'G-FIX2 - Price Protection 2010'
         when f.TARIFART='G-FIX4' then 'G-FIX4 - Click Energy'
         when f.TARIFART='G-FIX5' then 'G-FIX5 - Price Protection December 2009'
         when f.TARIFART='G-FIX13' then 'G-FIX13 - Fix & Fall'
         when f.TARIFART='G-FIX12' then 'G-FIX12 - Fix & Fall 2'
         when f.TARIFART='G-FIX10' then 'G-FIX10 - Click Energy 2'
         when f.TARIFART='G-FIX14' then 'G-FIX14 - Essentials (Social Tariff)'
         when f.TARIFART='G-FIX6' then 'G-FIX6 - Discounted Energy'
         when f.TARIFART='G-FIX16' then 'G-FIX16 - Click Energy 3'
         when f.TARIFART='G-FIX20' then 'G-FIX20 - Market Tracker'
         when f.TARIFART='G-FIX18' then 'G-FIX18 - Zero Carbon'
         when f.TARIFART='G-FIX21' then 'G-FIX21 - Click Energy 4'
         when f.TARIFART='G-FIX23' then 'G-FIX23 - Price Protection February 2009'
         when f.TARIFART='G-FIX22' then 'G-FIX22 - Click Energy 5'
         when f.TARIFART='G-FIX19' then 'G-FIX19 - 10% Discount Tracker'
         when f.TARIFART='G-FIX11' then 'G-FIX11 - Price Guarantee 2009'
         when f.TARIFART='E-FIX26' then 'E-FIX26 - Fixed Price 2011'
         when f.TARIFART='G-FIX26' then 'G-FIX26 - Fixed Price 2011'
         when f.TARIFART='E-FIX29' then 'E-FIX29 - ClickEnergy6'
         when f.TARIFART='G-FIX29' then 'G-FIX29 - ClickEnergy6'
         when f.TARIFART='E-FIX30' then 'E-FIX30 - DualFuel Extra (new Mason)'
         when f.TARIFART='G-FIX30' then 'G-FIX30 - DualFuel Extra (new Mason)'
         when f.TARIFART='E-FIX31' then 'E-FIX31 - 15% Discount Tracker'
         when f.TARIFART='G-FIX31' then 'G-FIX31 - 15% Discount Tracker'
         when f.TARIFART='E-FIX32' then 'E-FIX32 - Fixed Price 2012'
         when f.TARIFART='G-FIX32' then 'G-FIX32 - Fixed Price 2012'
         when f.TARIFART='E-FIX34' then 'E-FIX34 - Rollback'
         when f.TARIFART='G-FIX34' then 'G-FIX34 - Rollback'
         else 'Other'
    end Tariff      --Proposition
   
From

    Ever            a,
    Erch            b,
    ztucs_so_items  s,
    ztucs_so_items  df,
    EABL            h,
    EABLG           g,
    Ettifn          f,
(Select
  SUM(CASE WHEN h.ABLESTYP IN ('01','02')
           THEN 1
           ELSE 0
           END)  Customer_Meter_Reading,
  SUM(CASE WHEN h.ABLESTYP IN ('01','02','03','04')
           THEN 1
           ELSE 0
           END) Customer_All_Meter_Reading,
  g.anlage    as Category_Anlage   
From
EABL                      h,
EABLG                   g
Where
(h.ABLESTYP in('01','02','03','04')
OR h.ISTABLART in('01','02','06','A','AR','C','CL','CO',
                    'DR','FE','GA','GC','GD','GE','GF','GG','GH','GI','GJ','GN',
                    'GO','GP','GT','GU','GV','MO','MR','P','PP','SI','SM','T',
                    'TR','PR','Q','IV','Z'))
AND h.Mandt = g.Mandt
AND g.ABLBELNR = h.ABLBELNR
GROUP BY g.anlage ) Category

where
    a.loevm   = ' '                                    -- Current Contract
    AND b.fdgrp <> ' '   
    AND a.Anlage <> ' '
    AND f.Anlage <> ' '
    AND s.item_type in ('02', '03')                          -- Move-in or Acquisition
   
    AND a.auszdat = '99991231'
    AND (f.bis is null OR (f.bis ='99991231' AND f.inaktiv = ' ')) -- facts
    AND f.operand in('ERT-FIX','ERT-CAP','GRT-FIX','GRT-CAP')
          
    AND g.ABLESGR     = '06' 
    AND s.move_date >                           -- Opening Meter Read
        (    Case
                when a.cokey in('1000','2000','3000')
                then (SELECT TO_CHAR(SYSDATE - 400, 'yyyymmdd') FROM dual)         -- 52 WEEKS and 35 days ago data
            end
        )
    AND s.move_date <
        (
            Case
                when a.cokey IN('1000','2000','3000')
                then (SELECT TO_CHAR(SYSDATE , 'yyyymmdd') FROM dual)                 -- Current date
            end
        )
--    AND a.VKONTO  = b.VKONT
    AND a.MANDT = b.MANDT
    AND a.VERTRAG = b.VERTRAG
    AND b.VKONT (+) = s.VKONT
    AND s.MANDT = b.MANDT
    AND g.MANDT = h.MANDT
    AND g.ABLBELNR  = h.ABLBELNR
    AND a.anlage=g.anlage
    AND a.Anlage(+) = f.Anlage

    AND df.ITEM_TYPE in ('02', '03')                            ----Dual Fuel Check
    AND df.MANDT(+) = s.MANDT
    AND df.SO_KEY(+) = s.SO_KEY
    AND df.SO_ITEM_KEY(+) <> s.SO_ITEM_KEY
    AND df.SPARTE(+) <> s.SPARTE

    AND s.ANLAGE = Category.Category_Anlage
       
group by
/*+ parallel(b, 10) */
'hint6',
      case
        when nvl(df.SPARTE,'X') = 'X' then 'Dual Fuel'
        else
        case
        when b.SPARTE ='01' then 'Electricity'      --Product
        when b.SPARTE ='02' then 'Gas'
        end
    end ,
    f.TARIFART,
    a.cokey,
    b.fdgrp,
    Category.Customer_Meter_Reading,
    Category.Customer_All_Meter_Reading
explain plan
PLAN_TABLE_OUTPUT

Plan hash value: 2310571763

------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                   | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                            |                   |  2574 |   771K|       |    12M (14)| 40:16:00 |        |      |            |
|   1 |  PX COORDINATOR                             |                   |       |       |       |            |          |        |      |            |
|   2 |   PX SEND QC (RANDOM)                       | :TQ10010          |  2574 |   771K|       |    12M (14)| 40:16:00 |  Q1,10 | P->S | QC (RAND)  |
|   3 |    HASH GROUP BY                            |                   |  2574 |   771K|       |    12M (14)| 40:16:00 |  Q1,10 | PCWP |            |
|   4 |     PX RECEIVE                              |                   |  2574 |   771K|       |    12M (14)| 40:16:00 |  Q1,10 | PCWP |            |
|   5 |      PX SEND HASH                           | :TQ10009          |  2574 |   771K|       |    12M (14)| 40:16:00 |  Q1,09 | P->P | HASH       |
|   6 |       HASH GROUP BY                         |                   |  2574 |   771K|       |    12M (14)| 40:16:00 |  Q1,09 | PCWP |            |
|*  7 |        HASH JOIN                            |                   |  3696M|  1056G|       |    11M (12)| 39:02:50 |  Q1,09 | PCWP |            |
|   8 |         PX RECEIVE                          |                   | 59774 |    15M|       |  1390K (10)| 04:38:06 |  Q1,09 | PCWP |            |
|   9 |          PX SEND HASH                       | :TQ10008          | 59774 |    15M|       |  1390K (10)| 04:38:06 |  Q1,08 | P->P | HASH       |
|  10 |           BUFFER SORT                       |                   |  2574 |   771K|       |    12M (14)| 40:16:00 |  Q1,08 | PCWP |            |
|  11 |            NESTED LOOPS                     |                   | 59774 |    15M|       |  1390K (10)| 04:38:06 |  Q1,08 | PCWP |            |
|* 12 |             FILTER                          |                   |       |       |       |            |          |  Q1,08 | PCWC |            |
|  13 |              NESTED LOOPS OUTER             |                   | 59774 |    13M|       |  1370K (10)| 04:34:06 |  Q1,08 | PCWP |            |
|* 14 |               HASH JOIN                     |                   | 59774 |    12M|    87M|  1343K (10)| 04:28:45 |  Q1,08 | PCWP |            |
|  15 |                PX RECEIVE                   |                   |    13M|   723M|       | 27311   (6)| 00:05:28 |  Q1,08 | PCWP |            |
|  16 |                 PX SEND HASH                | :TQ10006          |    13M|   723M|       | 27311   (6)| 00:05:28 |  Q1,06 | P->P | HASH       |
|  17 |                  PX BLOCK ITERATOR          |                   |    13M|   723M|       | 27311   (6)| 00:05:28 |  Q1,06 | PCWC |            |
|* 18 |                   TABLE ACCESS FULL         | ZTUCS_SO_ITEMS    |    13M|   723M|       | 27311   (6)| 00:05:28 |  Q1,06 | PCWP |            |
|  19 |                PX RECEIVE                   |                   |    33M|  5104M|       |  1284K (11)| 04:16:49 |  Q1,08 | PCWP |            |
|  20 |                 PX SEND HASH                | :TQ10007          |    33M|  5104M|       |  1284K (11)| 04:16:49 |  Q1,07 | P->P | HASH       |
|* 21 |                  HASH JOIN BUFFERED         |                   |    33M|  5104M|    59M|  1284K (11)| 04:16:49 |  Q1,07 | PCWP |            |
|  22 |                   PX RECEIVE                |                   |  4882K|   540M|       |   950K (11)| 03:10:02 |  Q1,07 | PCWP |            |
|  23 |                    PX SEND HASH             | :TQ10004          |  4882K|   540M|       |   950K (11)| 03:10:02 |  Q1,04 | P->P | HASH       |
|* 24 |                     HASH JOIN               |                   |  4882K|   540M|       |   950K (11)| 03:10:02 |  Q1,04 | PCWP |            |
|* 25 |                      HASH JOIN              |                   |  1554K|   114M|       |   225K (10)| 00:45:09 |  Q1,04 | PCWP |            |
|  26 |                       PX RECEIVE            |                   |  1424K|    47M|       |   185K (10)| 00:37:10 |  Q1,04 | PCWP |            |
|  27 |                        PX SEND HASH         | :TQ10002          |  1424K|    47M|       |   185K (10)| 00:37:10 |  Q1,02 | P->P | HASH       |
|  28 |                         PX BLOCK ITERATOR   |                   |  1424K|    47M|       |   185K (10)| 00:37:10 |  Q1,02 | PCWC |            |
|* 29 |                          TABLE ACCESS FULL  | ETTIFN            |  1424K|    47M|       |   185K (10)| 00:37:10 |  Q1,02 | PCWP |            |
|  30 |                       PX RECEIVE            |                   |    15M|   613M|       | 39811  (10)| 00:07:58 |  Q1,04 | PCWP |            |
|  31 |                        PX SEND HASH         | :TQ10003          |    15M|   613M|       | 39811  (10)| 00:07:58 |  Q1,03 | P->P | HASH       |
|  32 |                         PX BLOCK ITERATOR   |                   |    15M|   613M|       | 39811  (10)| 00:07:58 |  Q1,03 | PCWC |            |
|* 33 |                          TABLE ACCESS FULL  | EVER              |    15M|   613M|       | 39811  (10)| 00:07:58 |  Q1,03 | PCWP |            |
|  34 |                      BUFFER SORT            |                   |       |       |       |            |          |  Q1,04 | PCWC |            |
|  35 |                       PX RECEIVE            |                   |    45M|  1678M|       |   724K (11)| 02:24:50 |  Q1,04 | PCWP |            |
|  36 |                        PX SEND HASH         | :TQ10000          |    45M|  1678M|       |   724K (11)| 02:24:50 |        | S->P | HASH       |
|* 37 |                         INDEX FAST FULL SCAN| PK_EABLG          |    45M|  1678M|       |   724K (11)| 02:24:50 |        |      |            |
|  38 |                   PX RECEIVE                |                   |   188M|  7554M|       |   279K (11)| 00:55:58 |  Q1,07 | PCWP |            |
|  39 |                    PX SEND HASH             | :TQ10005          |   188M|  7554M|       |   279K (11)| 00:55:58 |  Q1,05 | P->P | HASH       |
|  40 |                     PX BLOCK ITERATOR       |                   |   188M|  7554M|       |   279K (11)| 00:55:58 |  Q1,05 | PCWC |            |
|* 41 |                      TABLE ACCESS FULL      | ERCH              |   188M|  7554M|       |   279K (11)| 00:55:58 |  Q1,05 | PCWP |            |
|  42 |                FAST DUAL                    |                   |     1 |       |       |     2   (0)| 00:00:01 |        |      |            |
|  43 |                 FAST DUAL                   |                   |     1 |       |       |     2   (0)| 00:00:01 |        |      |            |
|* 44 |               TABLE ACCESS BY INDEX ROWID   | ZTUCS_SO_ITEMS    |     1 |    30 |       |     4   (0)| 00:00:01 |  Q1,08 | PCWP |            |
|* 45 |                INDEX RANGE SCAN             | PK_ZTUCS_SO_ITEMS |     1 |       |       |     3   (0)| 00:00:01 |  Q1,08 | PCWP |            |
|* 46 |             INDEX RANGE SCAN                | PK_EABL           |     1 |    25 |       |     3   (0)| 00:00:01 |  Q1,08 | PCWP |            |
|  47 |         BUFFER SORT                         |                   |       |       |       |            |          |  Q1,09 | PCWC |            |
|  48 |          PX RECEIVE                         |                   |    15M|   529M|       |    10M (12)| 34:19:02 |  Q1,09 | PCWP |            |
|  49 |           PX SEND HASH                      | :TQ10001          |    15M|   529M|       |    10M (12)| 34:19:02 |        | S->P | HASH       |
|  50 |            VIEW                             |                   |    15M|   529M|       |    10M (12)| 34:19:02 |        |      |            |
|  51 |             HASH GROUP BY                   |                   |    15M|   958M|    37G|    10M (12)| 34:19:02 |        |      |            |
|* 52 |              HASH JOIN                      |                   |   487M|    30G|    16G|  6939K (10)| 23:07:59 |        |      |            |
|* 53 |               TABLE ACCESS FULL             | EABL              |   414M|    11G|       |  4157K (12)| 13:51:29 |        |      |            |
|  54 |               INDEX FAST FULL SCAN          | PK_EABLG          |   488M|    16G|       |   707K  (9)| 02:21:26 |        |      |            |
------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   7 - access("S"."ANLAGE"="CATEGORY"."CATEGORY_ANLAGE")
  12 - filter("DF"."ITEM_TYPE"='02' OR "DF"."ITEM_TYPE"='03')
  14 - access("B"."VKONT"="S"."VKONT" AND "S"."MANDT"="B"."MANDT")
       filter("S"."MOVE_DATE">CASE "A"."COKEY" WHEN '1000' THEN  (SELECT TO_CHAR(SYSDATE@!-400,'yyyymmdd') FROM "SYS"."DUAL" "DUAL") WHEN
              '2000' THEN  (SELECT TO_CHAR(SYSDATE@!-400,'yyyymmdd') FROM "SYS"."DUAL" "DUAL") WHEN '3000' THEN  (SELECT TO_CHAR(SYSDATE@!-400,'yyyymmdd')
              FROM "SYS"."DUAL" "DUAL") END  AND "S"."MOVE_DATE"<CASE "A"."COKEY" WHEN '1000' THEN  (SELECT TO_CHAR(SYSDATE@!,'yyyymmdd') FROM "SYS"."DUAL"
              "DUAL") WHEN '2000' THEN  (SELECT TO_CHAR(SYSDATE@!,'yyyymmdd') FROM "SYS"."DUAL" "DUAL") WHEN '3000' THEN  (SELECT
              TO_CHAR(SYSDATE@!,'yyyymmdd') FROM "SYS"."DUAL" "DUAL") END )
  18 - filter("S"."ITEM_TYPE"='02' OR "S"."ITEM_TYPE"='03')
  21 - access("A"."MANDT"="B"."MANDT" AND "A"."VERTRAG"="B"."VERTRAG")
  24 - access("A"."ANLAGE"="G"."ANLAGE")
  25 - access("A"."ANLAGE"="F"."ANLAGE")
  29 - filter("F"."BIS"='99991231' AND ("F"."OPERAND"='ERT-CAP' OR "F"."OPERAND"='ERT-FIX' OR "F"."OPERAND"='GRT-CAP' OR
              "F"."OPERAND"='GRT-FIX') AND "F"."INAKTIV"=' ' AND "F"."ANLAGE"<>' ')
  33 - filter("A"."AUSZDAT"='99991231' AND "A"."LOEVM"=' ' AND "A"."ANLAGE"<>' ')
  37 - filter("G"."ABLESGR"='06' AND "G"."ANLAGE"<>' ')
  41 - filter("B"."FDGRP"<>' ')
  44 - filter("DF"."SPARTE"(+)<>"S"."SPARTE")
  45 - access("DF"."MANDT"(+)="S"."MANDT" AND "DF"."SO_KEY"(+)="S"."SO_KEY")
       filter("DF"."SO_ITEM_KEY"(+)<>"S"."SO_ITEM_KEY")
  46 - access("G"."MANDT"="H"."MANDT" AND "G"."ABLBELNR"="H"."ABLBELNR")
  52 - access("H"."MANDT"="G"."MANDT" AND "G"."ABLBELNR"="H"."ABLBELNR")
  53 - filter("H"."ABLESTYP"='01' OR "H"."ABLESTYP"='02' OR "H"."ABLESTYP"='03' OR "H"."ABLESTYP"='04' OR "H"."ISTABLART"='01' OR
              "H"."ISTABLART"='02' OR "H"."ISTABLART"='06' OR "H"."ISTABLART"='A' OR "H"."ISTABLART"='AR' OR "H"."ISTABLART"='C' OR "H"."ISTABLART"='CL' OR
              "H"."ISTABLART"='CO' OR "H"."ISTABLART"='DR' OR "H"."ISTABLART"='FE' OR "H"."ISTABLART"='GA' OR "H"."ISTABLART"='GC' OR "H"."ISTABLART"='GD'
              OR "H"."ISTABLART"='GE' OR "H"."ISTABLART"='GF' OR "H"."ISTABLART"='GG' OR "H"."ISTABLART"='GH' OR "H"."ISTABLART"='GI' OR
              "H"."ISTABLART"='GJ' OR "H"."ISTABLART"='GN' OR "H"."ISTABLART"='GO' OR "H"."ISTABLART"='GP' OR "H"."ISTABLART"='GT' OR "H"."ISTABLART"='GU'
              OR "H"."ISTABLART"='GV' OR "H"."ISTABLART"='IV' OR "H"."ISTABLART"='MO' OR "H"."ISTABLART"='MR' OR "H"."ISTABLART"='P' OR
              "H"."ISTABLART"='PP' OR "H"."ISTABLART"='PR' OR "H"."ISTABLART"='Q' OR "H"."ISTABLART"='SI' OR "H"."ISTABLART"='SM' OR "H"."ISTABLART"='T' OR
              "H"."ISTABLART"='TR' OR "H"."ISTABLART"='Z')
Note: On each of the tables we have a field called mandt, who is the field of indexes for all tables listed below.
We do not have privileges to create indexes in our database.


Please do what is necessary...

Thanks in advance

samuraibala wrote:
Hi all

When I run this query, it will take more time to run it... Please suggest me... I added parallael tips... can we add advice to this request

The biggest contributor under the plan displayed is the following view inline, that is running a series on the large table EABL sweep. You might consider adding a hint of parallel, for example like this:

(Select / * + parallel (h) * /)
SUM (CASE WHEN h.ABLESTYP IN ('01 ', ' 02')
THEN 1
0 OTHERWISE
END Customer_Meter_Reading),
SUM (CASE WHEN h.ABLESTYP IN ('01', '02', ' 03', ' 04')
THEN 1
0 OTHERWISE
END Customer_All_Meter_Reading),
g.Anlage as Category_Anlage
Of
EABL h,
EABLG g
Where
(h.ABLESTYP in ('01 ',' 02','03 ', ' 04')
OR h.ISTABLART ('01', ' 02 ', ' 06', 'A', 'AR', ' it 'CL', 'CO',)
'DR', 'FE', 'GA', 'GC', 'GD', "GE", "GF", "GG", "GH", "GI", "GJ", "GN"
'GO', 'PG', 'GT', 'GU', 'GV', 'MO', 'SIR', 'P', 'PP', 'IF', 'DM', 'T'.
'TR', 'PR', 'Q', 'IV', 'Z'))
AND h.Mandt = g.Mandt
AND g.ABLBELNR = h.ABLBELNR
GROUP BY g.anlage) category

I don't know if the following two expressions are sensitive:

First of all, you need not to use a scalar subquery to evaluate this constant expression, a simple TO_CHAR (SYSDATE - 400, 'YYYYMMDD') should be sufficient
Secondly, why do you not use TO_CHAR? Is MOVE_DATE a TANK or a DATE column? If it's a DATE column (as its name suggests) then simply use trunc (SYSDATE - 400) instead of TO_CHAR (...)
Thirdly, what happens if HOKEY is not in ('1000', '2000' 3000')? Then these expressions return the NULL value which will efficiently filter on these files. What is your intention?

AND s.move_date >-read meter opening
(Case
where a.cokey in ('1000 ',' 2000 ', ' 3000')
then (SELECT TO_CHAR(SYSDATE-400, 'yyyymmdd') FROM dual) - 52 WEEKS and 35 weeks ago given
end
)
AND s.move_date
(
Case
where a.cokey IN ('1000 ', '2000','3000 ')
then (SELECT TO_CHAR (SYSDATE, 'yyyymmdd') FROM dual) - current date
end
)

I don't think that it is a valid position for a tip, so I don't know what plan you make with it?

Group
/ * + parallel (10B) * /.

Kind regards
Randolf

Oracle related blog stuff:
http://Oracle-Randolf.blogspot.com/

SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/

Tags: Database

Similar Questions

  • accordion jQuery how to reduce the default Panel

    Hi I'm using the latest Dreamweaver how to reduce the Panel so that none are open when the page opens.

    mayramoca33 wrote:

    foldingType: Boolean

    By default:false

    If all the sections can be closed at the same time. To collapse the current section.

    Code examples:

    Initialize a Accordion with the collapsible option specified:

    1

    $( ".selector" ).accordion({ collapsible: true });

    Get or set the collapsible option, after init:

    1

    2

    3

    4

    5

    // getter

    var collapsible = $( ".selector" ).accordion( "option", "collapsible" );

    // setter

    $( ".selector" ).accordion( "option", "collapsible", true );

    Hi Nancy I see this

    and I click on reducible in property panel and it gives me this:

    But I can't understand how to reduce the first Panel

    http://restoring-health.NET/resources.html

    Try the following:

  • How to reduce the size of the request

    Hi all

    Can anyone suggest me how to reduce the size of the query.



    / * In format on 12/07/2011 11:02 (trainer more v4.8.8) * /.
    SELECT prs.pa_rqst_srvc_sid,
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5031'
    AND ped.aaa_segment_loop_nmbr = "2000F") revenue_iid,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5013'
    AND ped.aaa_segment_loop_nmbr = "2000F") x12_code_list_qlfr_lkpcd,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5026'
    AND ped.aaa_segment_loop_nmbr = "2000F") procedure_iid,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5027'
    AND ped.aaa_segment_loop_nmbr = "2000F") mdfr_code,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5028'
    AND ped.aaa_segment_loop_nmbr = "2000F") mdfr2_code,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5029'
    AND ped.aaa_segment_loop_nmbr = "2000F") mdfr3_code,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5030'
    AND ped.aaa_segment_loop_nmbr = "2000F") mdfr4_code,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5014'
    AND ped.aaa_segment_loop_nmbr = "2000F") rqst_prcdr_amt,.
    (SELECT prpre.erroneous_data_value
    OF pa_error EP,.
    pa_error_detail ped,
    pa_request_procedure_run_error prpre
    WHERE pe.pa_error_sid = ped.pa_error_sid
    AND ped.pa_error_sid = prpre.pa_error_sid
    AND ped.oprtnl_flag = 'A '.
    AND prpre.oprtnl_flag = 'A '.
    AND prpre.pa_rqst_prcdr_sid = prp.pa_rqst_prcdr_sid
    AND pe.pa_error_nmbr = '5015'
    AND ped.aaa_segment_loop_nmbr = "2000F") srvc_line_rate,.
    "NA" drug_desc, product_service_id "NA", "NA" uom_code,.
    "NA" rqst_prcdr_units
    IN ptr pa_transaction_request.
    input_acknwldgmnt AI,
    input_batch_file ibf,
    PR pa_request,
    PRS pa_request_service,
    pa_request_procedure prp
    WHERE ptr.input_acknwldgmnt_sid = ia.input_acknwldgmnt_sid
    AND ia.input_batch_file_sid = ibf.input_batch_file_sid
    AND ptr.pa_trnsctn_rqst_sid = pr.pa_trnsctn_rqst_sid
    AND pr.pa_rqst_sid = prs.pa_rqst_sid
    AND prs.pa_rqst_srvc_sid = prp.pa_rqst_srvc_sid
    AND pr.oprtnl_flag = 'A '.
    AND prs.oprtnl_flag = 'A '.
    AND ptr.oprtnl_flag = 'A '.
    AND prp.oprtnl_flag = 'A '.
    AND prs.rqst_ctgry_lkpcd = 'AR '.
    AND ibf.original_file_name = 'HIPAA.165760000.20110613I001.278_IRej.dat ';


    Thank you
    Prakash P

    OK, I guess it's the 2 typos I just corrected (see previous posts)

  • How to reduce the size of the records Quicktime file?

    On my Mac, they take as much space as 1 GB for a film record or a screen for 2 minutes.

    iPad records take up much less space and are of a higher quality.

    Anyone know how to reduce the size of the file, or at least tell me why they use so much space? I have only 128 GB.

    A big thank you to you all, good people.

    I don't see that you can export out of other than QT. MOV

    but you can use an external converter

    While it is mainly used to convert video files to DVD it will also convert video files.

    https://handbrake.fr

  • How to reduce the amount of storage to free up more space

    How to reduce the amount of storage to free up more space

    There are several things you could do.

    Save your iPad to iTunes on a computer or create an iCloud account, find out how much storage space you need for data and if you need to buy storage space monthly, to do. Then save your iPad to iCloud.

    HOWEVER the data backup on your iPad using WiFi or Bluetooth wireless, local devices such as portable hard drives or small flash memory drives designed for use with mobile devices, like the iPad.

    Remove the applications that you use is no longer. If you start to use them in the future, you can re-download them the iOS App Store.

    Thin out / remove the amount of music and movies you have on your iPad.

    If you make a backup of your iPad, you can thin out / delete all images stored in the iOS App Photos.

    Thin out / remove all books electronic, iBooks, eMagazines, and PDF documents, you have stored on your iPad. Magazines and e-books can be redownloaded at a later date.

  • How to reduce the brightness of the screen under the standard level

    Hello!

    How to reduce the brightness of the screen under the standard level in ThinkPad T520?

    I think we can somehow, but I don't know how. I reduced the brightness to zero with the Fn button + button end, but this is not enough, I want to make the screen darker, because my eyes get tired.

    The last (from Lenovo) Intel graphics driver is here:
    http://support.Lenovo.com/us/en/downloads/MIGR-77038

    This should provide a decent lower limit on the brightness. If the installation complains about the non supported hardware, force the installation using the devices and Disk Manager. (Something like this: http://forums.laptopvideo2go.com/topic/11997-have-disk-method-for-windows-7-vista/ )

    If this does not work, try f.lux (https://justgetflux.com/). It has a dimming function software (of course, he loses the contrast).

  • Can anyone suggest how to reduce the size of the text

    Can anyone suggest how to reduce the size of the text here, and most of the other programs

    used? I'd be happy if someone could tell me how. I looked everywhere, but

    no luck!

    Best regards, Reltsen

    Hello

    Where exactly you want to reduce the text (browser, Explorer or on any application)?

    If you try to do it on a web browser like Internet Explorer see the link for the procedure.

    You can also check this link

    Thank you.

  • How to reduce the size of the text only 500 CV Ko asked

    original title: word format

    How to reduce the size of the text only 500 CV Ko asked

    This is a forum for Windows Vista - so I assume you are using WordPad or Notepad?  What is an email that you put together without attachments?

    Type less.  More abbreviate.  Choose the unnecessary parts.

    If you have a single given pure text document you posted and assumptions that must be made because of that-, then these are your choices.

    If you have a version of some processing (such as Microsoft Office Word 2000, XP, 2003, 2007, or 2010) and this is what you are asking about - everything will depend on the version of Word that you have, etc.-, but the General advice above remains true with the addition of "stay away from fancy formatting.

  • How to reduce the coverage area

    Hello

    We have our office in a campus IT several floors with other businesses in the area. We plan to go wireless in the whole of the Office (full 1 floor). Can we do anything to reduce the signal from outside the offices in order to avoid the attacks/hacks? We use 1240AP.

    Outside the use of security, I want o know how to reduce the coverage area... the parameters of power etc.?

    Thank you

    There are a few things that can help.

    Placement of the AP, down the power, by cutting basic-rate further down to shrink the cell, using directional antennas to better focus the signal and the deployment of obstacles that affect signals (sheet Tin, plants, people, etc.).

    It will take some creativity, planning and measurement

  • How to reduce the height of a table which is with PanelCollection and pc will find panelbox and pb is panelgridlayout and pgl is at the center of tableFirstTemplate?

    Mr President.

    How to reduce the height of a table which is with PanelCollection and pc will find panelbox and pb is panelgridlayout and pgl is at the center of tableFirstTemplate?

    Concerning

    Normally at the height of the table control you need property autoheightRows -1 and then set height in the table like this inlinestyle

    height: 300px;

  • How to reduce the size of the file CPTX in 8 Captivate?

    Hi all

    How to reduce the file size of my .cptx in captivate 8? It is the size of the cptx 380MB file, but what I have inside are only a few images to start a new module.

    I deleted all unused items in the library and I have only 4 slides with some images in each slide. No interaction and audio included still not even in my master slide.

    Please help me. Thank you.

    Pak-choi

    Copy a new project and test slides.

    Anthony

  • How to reduce the size of the file for documents

    How to reduce the size of the file for documents

    The full version of Acrobat can do (not for free Acrobat Reader) for the pdf files.

    Please give us some info like what type of file you are talking about and software that you have at least.

  • ADF: How to print the query and the query passed into the class executeQueryForCollection methof impl VO parameters.

    Hello

    Kindly let me know how to print the query, and the parameters passed to it? I tried with the params parameter in super.executeQueryForCollection (qc, params, noUserParams); but could not succeed.

    I need save the query and the parameters passed to it. Kindly help.

    Thanks in advance,

    Kalpana.

    Here you go

    Coding with Passion: Oracle ADF - Debug Mode object query with parameters

  • How to frame the query?

    Uses oracle ebs r12

    I have a table of data is

    Operation_seq Type statusflag SeqNum
    1 10A Y
    2 20 b Y
    3 30 c Y
    4 40 D Y
    5 50 e N
    6 60 f Y

    I want to write a query in which I want to take only 1 record operation_seq = 50 and Statusflag is N and all other interventions seq status is there.

    My query must return only 50 operation when the status of 50 is N and any other status is Y.

    Help, please.

    Thank you
    Lavan

    LAVANKV wrote:
    This statusflag can be (null or N), then how to frame the query.

    Simply wrap the statusflag with NVL column, you should be good.

    SQL> with t
      2  as
      3  (
      4  select 1 seqnum, 10 operation_seq, 'a' type, 'Y' statusflag from dual union all
      5  select 2 seqnum, 20 operation_seq, 'b' type, 'Y' statusflag from dual union all
      6  select 3 seqnum, 30 operation_seq, 'c' type, 'Y' statusflag from dual union all
      7  select 4 seqnum, 40 operation_seq, 'd' type, 'Y' statusflag from dual union all
      8  select 5 seqnum, 50 operation_seq, 'e' type, '' statusflag from dual union all
      9  select 6 seqnum, 60 operation_seq, 'f' type, 'Y' statusflag from dual
     10  )
     11  select seqnum, operation_seq, type, statusflag
     12    from (
     13            select t.*, count(decode(statusflag, 'Y', 1, null)) over() cnt_1, count(*) over() cnt_2
     14              from t
     15         )
     16   where operation_seq = 50
     17     and nvl(statusflag, 'N') = 'N'
     18     and cnt_2-cnt_1 = 1
     19  /
    
        SEQNUM OPERATION_SEQ T S
    ---------- ------------- - -
             5            50 e
    
  • PDF file is too big (7MB). Need a pdf with max file size 4 MB. How to reduce the size of a pdf file?

    PDF file is too big (7MB). Need a pdf with max file size 4 MB. How to reduce the size of a pdf file?

    Try optimizing PDF of Acrobat Pro.

  • How to write the query option in expdp

    Hi Please someone help me how to write the query option in expdp... .in expdp using the query option...

    where AM columnname between 5 May 12 02:57:00.000' and ' 02:59:59.999 6 May 12: ';


    Please do what is necessary...

    Pavan Kumar says:
    QUERY = (columnname scott.test: "where between 5 May 12 02:57:00.000 h ' and ' 6 May 12 AM 02:59:59.999'")

    Who will fail in databases, because you assume nls_date_format. How it is difficult to put to_date() surround channels? Rather than play with quotation marks, using one parfile thusly.

    query=table_owner.table_1:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
    query=table_owner.table_2:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
    query=table_owner.table_3:"where business_date between to_date('20120505025700 am','yyyymmddhhmiss am') and to_date('20120505025959 am','yyyymmddhhmiss am')"
    

    You do not have to have all the clauses in a single line, as they are side by side parfile, which would be enough. For this reason parfile is better than the command line in order to avoid all the back-citing dance.

Maybe you are looking for

  • Replacement of lost text

    All my text replacements are lost (except on my way!) after the upgrade to iOS 10 on my iPhone 5SE. IS this a bug?

  • Find a character

    I recently had to reinstall Firefox, and I'll try to find the character I've had on this subject (I don't remember the name unfortunately). It looks like the character of Dark Light, but he also changed the colors of the menu to be too dark. Does any

  • My computer guard shut down, and the report said "panic."?

    The computer stops regularly without promting, then automatically restarts after a few seconds. The reports said the word 'panic', as well as a bunch of stuff I don't understand. Much obliged for any suggestions as to what may be the problem.

  • Portege R500 - unrecognized SD cards

    Hello!I have the R500 with WinXP SP3 and player SD slot does not properly small or large SD cards. Device Manager displays a certain activity when a card is inserted, but the resource (My Computer) Manager shows not all SD cards / new readers. Any id

  • BDP-S570 - does not connect to internet via wifi

    I just bought this today and it does not connect to the internet via wi - fi. I'm entering properly (my iphone, ipad and computers connect very well). I called tech support and they had no idea what either. I then connected with an ethernet cable, up