Min max date in query

Hi
I got records as below
ID caseno callopendate callclosedate
1 4 01-mar-2006 30-mar-2006
2 4 14-mar-2006 23-apr-2006
3 5 01-may-2006 03-mar-2006
4 5 01-jan-2006 230-aug-2006
5 5 01-jun-2006 130-dec-2006
but i want the out put like below
ID caseno callopendate callclosedate mincallopendate maxcallclosedte
1 4 01-mar-2006 30-mar-2006 01-mar-2006 23-apr-2006
2 4 14-mar-2006 23-apr-2006 01-mar-2006 23-apr-2006
3 5 01-may-2006 03-mar-2006 01-jan-2006 13-dec-2006
4 5 01-jan-2006 23-aug-2006 01-jan-2006 13-dec-2006
5 5 01-jun-2006 13-dec-2006 01-jan-2006 13-dec-2006
so basically group by caseno of max,min date
assuming the all fields are in same table
Thanks a lot

Is this ?
select ID,caseno,callopendate,callclosedate
,min(callopendate) over (partition by caseno) mincallopendate
,max(callclosedate) over (partition by caseno) maxcallclosedte
from your_table
Please reffer [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/functions001.htm#i81407]Analytic Functions, [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/functions085.htm#i89072]MAX and [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/functions087.htm#i1280029]MIN

Similar Messages

  • Charts- how to include data points outside of min/max ranges?

    I'm trying to have a chart that has a horizontal datetime axis showing a full day of info collected at irregular intervals and a linear vertical axis that acknowledges but cuts off datapoints that are above a certain number.
    For the vertical axis I thought I could just apply min/max values to achieve this, but I've found that if I have a maximum value of 25, any datapoints with a value above that are simply removed from the chartseries.items dataset (was hoping I might get something like a plot point near the top with an arrow, or the line going off the top and coming back.. but it's simply removed from the dataset.)
    For the horizontal I was wanting to show a line all the way across regardless of where the first and last datapoints fell.. how I hoped to achieve this was to retrieve the points immediately following and preciding the period but limit the min max date, so that it would theoretically show the lines going off the edge but not the actual points.
    i've thought of a few things that might work...
    is there some way to have the vertical axis parabolic so that it's mostly linear from 0-20 and then values above that take cover much less space? I don't have any idea how I'd go about setting that up..
    I have also thought about placing a dummy point at the beginning and end of the datetimeaxis... ie..
    time = chart.minimum and
    value = (first value today - last value yesterday)/(time between first time today and last time yesterday)
    .. and then would have to make those points specifically not interactive.. and i don't know how possible that is.  Also if there's a way not quite so involved that would also be awesome.
    Any feedback on how to approach this is greatly appreciated!
    Or is there something built into flex already that I've missed?

    In article <[email protected]>,
    chutla wrote:
    > Greetings!
    >
    > You can use any of the 3D display vi's to show your "main" 3d
    > data, and then use color to represent your fourth dimension. This can
    > be accessed via the property node. You will have to set thresholds
    > for each color you use, which is quite simple using the comparison
    > functions. As far as the data is concerned, the fourth dimension will
    > be just another vector (column) in your data file.
    chutla, thanks for your post, but I don't want a 3D display of the
    data....
    > Also, check out
    > the BUFFER examples for how to separate out "running" data in real
    > time.
    Not clear to me what you mean, but will c
    heck the BUFFER examples.
    > As far as autoscaling is concerned, you might have to disable
    > it, or alternatively, you could force a couple of "dummy" points into
    > your data which represent the absolute min/max you should encounter.
    > Autoscaling should generally be regarded as a default mode, just to
    > get things rolling, it should not be relied on too heavily for serious
    > data acquisition. It's better to use well-conditioned data, or some
    > other means, such as a logarithmic scale, to allow access to all your
    > possible data points.
    I love autoscaling, that's the way it should be.
    germ Remove "nospam" to reply

  • BI Query : Min & Max Values

    Hi all,
    I have a query regarding finding the max and min values based on Keyfigure.
    Below are the values which i get in the report.From these values i need the Max and Min value separately based on the keyfigure.
    I tried option in Aggregation tab and Calculation tab.However i am getting the Maximum value correctly whereas minimum value shows as Zero.
    0.58
    0.65
    0.88
    Please guide me and help me to resolve this issue.
    Thanks & Regards,
    Kavitha

    Hi,
    The following is the sample data.
    Calday
    Inspection Point
    P1
    Min      Max
    01.04.2014
    01.04.14-06.HRS |
    0.00
    0.58
    01.04.14-10.00HRS |
    0.00
    0.65
    01.04.14-14.00HRS |
    0.00
    0.88
    We are getting maximum value as 0.88 but min value should be 0.58 but we are getting 0.00.
    Please help me to resolve the issue

  • How to Get the min,max and original values in a single query

    Hi,
    I have a task where in i have to the min , max and the original values of  a data set .
    I have the data like below and i want the target as well as mentioned below
    SOURCE
    DATASOURCE
    INTEGRATIONID
    SLOT_DATE
    SLOT1
    SLOT2
    SLOT3
    SLOT4
    SLOT5
    SLOT6
    SLOT7
    SLOT8
    SLOT9
    SLOT10
    1
    101
    201111
    100
    100
    200
    100
    100
    100
    300
    300
    300
    300
    1
    101
    2011112
    200
    200
    200
    200
    100
    100
    100
    100
    200
    300
    TARGET
    DATASOURCE
    INTEGRATIONID
    SLOT_DATE
    SLOT_VALUE
    SLOT MIN
    SLOT_MAX
    SLOT NUMBER
    1
    101
    201111
    100
    1
    2
    SLOT1
    1
    101
    201111
    100
    1
    2
    SLOT2
    1
    101
    201111
    200
    3
    3
    SLOT3
    1
    101
    201111
    100
    4
    6
    SLOT4
    1
    101
    201111
    100
    4
    6
    SLOT5
    1
    101
    201111
    100
    4
    6
    SLOT6
    1
    101
    201111
    300
    7
    10
    SLOT7
    1
    101
    201111
    300
    7
    10
    SLOT8
    1
    101
    201111
    300
    7
    10
    SLOT9
    1
    101
    201111
    300
    7
    10
    SLOT10
    1
    101
    2011112
    200
    1
    4
    SLOT1
    1
    101
    2011112
    200
    1
    4
    SLOT2
    1
    101
    2011112
    200
    1
    4
    SLOT3
    1
    101
    2011112
    200
    1
    4
    SLOT4
    1
    101
    2011112
    100
    5
    8
    SLOT5
    1
    101
    2011112
    100
    5
    8
    SLOT6
    1
    101
    2011112
    100
    5
    8
    SLOT7
    1
    101
    2011112
    100
    5
    8
    SLOT8
    1
    101
    2011112
    200
    9
    9
    SLOT9
    1
    101
    2011112
    300
    10
    10
    SLOT10
    e
    so basically i would first denormalize the data using the pivot column and then use min and max to get the slot_start and slot_end.
    But then i
    can get the min and max ... but not the orignal values as well.
    Any thoughts would be appreciated.
    Thanks

    If you want to end up with one row per slot per datasource etc, and you want the min and max slots that have the same value as the current slot, then you probably need to be using analytic functions, like:
    with t as
    (SELECT 1 datasource,101    INTEGRATIONID, 201111     slotdate, 100    SLOT1, 100        SLOT2,    200    slot3, 100    slot4, 100    slot5, 100    slot6, 300    slot7, 300    slot8, 300    slot9, 300 slot10 FROM DUAL  union all
    SELECT 1,    101,    2011112,    200,    200,    200,    200,    100,    100,    100,    100,    200,    300 FROM DUAL),
    UNPIVOTED AS
    (SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,1 SLOT,SLOT1 SLOT_VALUE
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,2 SLOT,SLOT2
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,3 SLOT,SLOT3
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,4 SLOT,SLOT4
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,5 SLOT,SLOT5
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,6 SLOT,SLOT6
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,7 SLOT,SLOT7
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,8 SLOT,SLOT8
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,9 SLOT,SLOT9
    FROM T
    UNION ALL
    SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,10 SLOT,SLOT10
    FROM T)
    select DATASOURCE,INTEGRATIONID,SLOTDATE,slot,slot_value,min(slot) OVER (partition by datasource,integrationid,slotdate,rn) minslot,
        max(slot) OVER (partition by datasource,integrationid,slotdate,rn) maxslot
    FROM   
      select DATASOURCE,INTEGRATIONID,SLOTDATE,max(rn) over (partition by datasource,integrationid,slotdate order by slot) rn,slot,slot_value
      FROM
        (SELECT DATASOURCE,INTEGRATIONID,SLOTDATE,slot,slot_value,
              case when row_number() over (partition by datasource,integrationid,slotdate order by slot) = 1 or
              lag(slot_value) over (partition by datasource,integrationid,slotdate order by slot) <> slot_value
                  then row_number() over (partition by datasource,integrationid,slotdate order by slot)
                  ELSE null
                  END rn
        from unpivoted
    order by DATASOURCE,INTEGRATIONID,SLOTDATE,slot 

  • Min/ Max interval data storage

    OK, so what I am trying to do is scan 2 voltages at 3K, temporarily write that data to a file or buffer, read the min and max values, and log those to a file once per minute. I'm at the point where I can scan and display the data, but really don't know where to go next. Any thoughts or ideas would be much appreciated. Thanks
    Attachments:
    NI-6343-2CH VDC min-max.vi ‏45 KB

    You only need a single loop. You can use the "elapsed time" express VI to signal when time has elapsed, and simply use a case structure to append the averages to the data before writing (in the false case just wire the current data across). You should also open the file before the loop, append inside the loop, and only close the file once the loop completes. You can use the min&max ptbypt VI to keep track of the min and max for each interval or just keep track of it using a shift register.
    LabVIEW Champion . Do more with less code and in less time .

  • DateTimeAxis min/max bug? Problems with consistent padding. Date Wrapping.

    I have been working on a problem with a BarChart object that I've created using dynamic data.
    My primary issue is that I can't seem to get the proper min/max values to set for the chart.
    To solve this I manually found the min and max of the data set of Dates and set the min and max of the chart. This allowed me to finally see all the floating custom bars (each bar is rendered with a user set fill), however now if I have a bar that extends over a year change the horizontal axis labels do not wrap the date properly, so instead of 2/10 (feb 2010) being the last date, 12/09 (dec 2009) is the last date.
    I've been trying to dynamically adjust the padding based upon a change event, but so far to no avail. Partially I think because I'm not sure which event for the function to fire on.
    private function dateAxisGen(r:Array):void {
                    var min:Number = r[0].startTime.time;
                    var max:Number = r[0].endTime.time;
                    const PAD:Number = 2;
                    const MILLISEC_IN_MONTH:Number = 2629743830;
                    const MILLISEC_IN_WEEK:Number = 604800000;
                    const MILLISEC_IN_DAY:Number = 864;
                    for (var i:int = 1; i < r.length; i++) {
                        var o:OperationXT = OperationXT(r[i]);
                        min = Math.min(o.startTime.time, min);
                        max = Math.max(o.endTime.time, max);
                    // Calculates the maximum range, then adds an appropriate
                    // padding to the chart via extra time. TODO
                    /* var range:Number = max - min;
                    if(range >= MILLISEC_IN_MONTH) {
                        dAxis.padding = (MILLISEC_IN_WEEK/1000000)/PAD;
                        dAxis.padding = (MILLISEC_IN_WEEK/1000000)/PAD;
                    } else if(range >= MILLISEC_IN_WEEK) {
                        dAxis.padding = (MILLISEC_IN_DAY)/PAD;
                        dAxis.padding = (MILLISEC_IN_DAY)/PAD;
                    } else {
                        dAxis.padding = PAD;
                    dAxis.minimum = new Date(min);
                    dAxis.maximum = new Date(max);
    this, however, does not adjust the padding properly when an operation is removed from the list. Not to mention I still have the date wrapping error. It gives me the following error:
    Cannot access a property or method of a null object reference.
        at mx.charts::AxisRenderer/measureHorizontalGutters()[C:\work\flex\dmv_automation\projects\d atavisualisation\src\mx\charts\AxisRenderer.as:2244]
        at mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\work\flex\dmv_automation\projects\dat avisualisation\src\mx\charts\AxisRenderer.as:1858]
        at mx.charts::AxisRenderer/adjustGutters()[C:\work\flex\dmv_automation\projects\datavisualis ation\src\mx\charts\AxisRenderer.as:1534]
        at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\work\flex\dmv_automation\pro jects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2239]
        at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\work\flex\dmv_automation\pr ojects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1366]
        at mx.core::UIComponent/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8065]
        at mx.managers::LayoutManager/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:663]
        at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects \framework\src\mx\managers\LayoutManager.as:736]
        at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\ projects\framework\src\mx\managers\LayoutManager.as:1069]
    Any help with my problem would be greatly appreciated.
    ADDITIONAL INFO:
    Alright, so I've discovered that the ONLY time the date wrapping error occurs is when the axis labels contain only the month and year, any other time it places it properly.
    Does anyone know where I can report this bug?

    Perre wrote:I'm used to being able to pick one or a couple of songs and then adding it a specified playlist. Is this impossible in sonata?
    It's clearly not impossible, just different than you expect. Create your playlist as you want it to appear in the Current tab (meaning don't dump every single song from your library in there, just the ones you want) and then save the playlist.
    Perre wrote:And if I try to play the m3u file created (the one with every song listed) through freevo I get a message that the directory is empty. What am I doing wrong??
    Look at save_absolute_paths_in_playlists in your mpd.conf.

  • How to get max date in variable using  dynamic query

    Hi,
    the following code gets all dates from sourcetable i want only max date , so i thought max function can be added and it will work
    but still i have to create a table for one value(scalar) can get it in any other effeciant way.
    declare
    TYPE date_string IS TABLE OF VARCHAR(1000);
    date_obj date_string;
    BEGIN
    EXECUTE IMMEDIATE 'SELECT to_char('''||day1||'-'||month1||'-'||year1||''') FROM '||source_schema||'.'|| sourcetable ||'' bulk collect INTO date_obj;
    FOR indx IN date_obj.FIRST..date_obj.LAST loop
    dbms_output.put_line(
    date_obj(indx));
    END loop;
    DBMS_OUTPUT.PUT_LINE('Sample output');
    END;
    yours sincerely

    944768 wrote:
    the following code gets all dates from sourcetableNo it doesn't. What is the datatype of day1, month1 and year1? They cannot be DATE datatypes otherwise your TO_CHAR would fail with all that concatenation going on. And your TO_CHAR is returning a VARCHAR2 datatype... so you cannot say that it is getting all dates... because there are no DATE datatypes returned. It's getting a lot of strings, but certainly not DATE's.
    i want only max date , so i thought max function can be added and it will work You can use the MAX function on a DATE datatype, but not on strings (at least not in the way you intend it to work).
    Converting it to a DATE before doing the MAX will allow you to get the maximum date (assuming the date format is correct)
    EXECUTE IMMEDIATE 'SELECT max(to_date(to_char('''||day1||'-'||month1||'-'||year1||'''),''DD-MM-YYYY'')) FROM  '||source_schema||'.'|| sourcetable ||'' bulk collect INTO date_obj;Then you will find have the other issues...
    a) you are then going to be fetching your DATEs in to a collection of VARCHAR strings. (Not even VARCHAR2, very poor). This should be DATE datatype
    b) you are bulk collecting into a collection, when you are using MAX which will return a single value in your example
    And you really should address the design issues:
    c) why are day, month and year, not being stored in the database as a single DATE datatype in the first place
    d) why does your code not know the name of the table it's querying requiring the use of very poor dynamic SQL techniques.
    e) why are you loading data in a collection in expensive PGA memory... what can't you do in SQL that requires you to collect the data into memory first?

  • Max (date) in sub-query

    I have an issue with a big view and several queries running on it where the max (date) is required in the sub-select (example below). When I run traces and explain, the perf problem is when the where cluase is evaluated, the view is pulled second time - so I basically use this view twice. The fact that the date in the underlined table is indexed did not help.
    I tried to use "ROW_NUMBER() OVER (ORDER BY date ASC) AS row_number, " rather to select the max(date) in teh sub query but I get only 1 records returned by the query instead the expected about 25,000.
    Need help on how to correct the max(date) to perform better and also to understand how to correct the ROW_NUMBER() not to limit me to 1 row.
    Thanks a lot for the help, Tom
    create view test_date as select * from user_objects;
    select * --(I have specific columns in the real query)
    from test_date t1
    where LAST_DDL_TIME in
    (select max(LAST_DDL_TIME)
    from test_date t2
    where t1.OBJECT_ID=t2.OBJECT_ID --(more clauses to limit the result but not reflecting the problem)
    and t1.OBJECT_NAME =t2.OBJECT_NAME
    and OBJECT_TYPE not in('TABLE')
    group by t2.OBJECT_ID , t2.OBJECT_NAME )

    I got the query to run - with dense ranck and row-Number I get the same results. My partition by cluse was wrong. But the perfromance is not much better.
    Any other idea on how to optimize a query that uses pattern like below and needs to return all rows from a table that have the max enter date.
    Thanks a lot, tom
    Example:
    col1 col2 col3
    1 sysdate 'I need this record'
    2 sysdate 'I need this record'
    3 sysdate 'I need this record'
    4 sysdate 'I do NOT need this record'
    5 sysdate 'I do NOT need this record'
    5 sysdate+3 'I need this record'
    5 sysdate+2 'I do NOT need this record'
    4 sysdate+3 'I need this record'
    4 sysdate+2 'I do NOT need this record'
    4 sysdate+1 'I do NOT need this record'
    My query corrently is using the following construcion:
    select col1, col2 , col3
    from test_table t
    where 1,2,3
    and col3 = (select max(col3) from test_table t2 where t2.col1 = t.col1) group by t2.col1

  • Query - Filter by a specific dynamic date - Return only the max date record

    Hello experts,
    I'm building a query. In this query I have a filter named validity date. I need to select a record where the max date is less than this filter.
    For example:
    Comp. Code | Plant | Mat. | Cost Type | Valid. Date | Value
    0000000001   00001  0001  xxxxxxxx    12.05.2008   2,00
    0000000001   00001  0001  xxxxxxxx    09.05.2008   1,00
    0000000001   00001  0001  xxxxxxxx    05.05.2008   0,50
    If the user set 13.05.2008 in the filter, the report should return:
    0000000001   00001  0001  xxxxxxxx    12.05.2008   2,00
    If the user set 11.05.2008 in the filter, the report should return:
    0000000001   00001  0001  xxxxxxxx    09.05.2008   1,00
    If the user set 08.05.2008 in the filter, the report should return:
    0000000001   00001  0001  xxxxxxxx    05.05.2008   0,50
    The problem is that the date will be dynamic and I'll need to return just one line for a combination of Company Code, Plant, Material and Cost Type. First of all I would like to know the best way to do it. Do I need to use virtual key figure? If so, anyone could tell me some steps to do it?
    Thanks in advance,
    Helder

    Not Virtual KeyFigure.
    You can achieve this with Restricted KeyFigure with the restriction with CalDay (Variable) which user input while Running the Query. Its more like a Bucket. SAP Delivered Buckets Query is in the below link. Check that query you will understand better about Bucket.
    http://help.sap.com/saphelp_nw04/helpdata/en/40/94af39a3488979e10000000a11402f/content.htm
    If not clear try to Install the BC Query and play with that you will know better.
    Thanks
    Sriram

  • Global Change or filter based on Min and Max dates

    Hi Guys,
    Hopefully there is a genius out there that is an expert with filters and or global changes, I am after a solution and can’t work out if it is possible to do in P6.
    Based on a filter (using codes to select a group of activities) I want to write a value into two date UDF Fields can I:
    Run a global change to give the earliest and latest date in the group and write the result to all tasks in the group? or
    Is there a mindate maxdate option in Global change or filter? Or
    If these tasks were grouped in the activity view can a global change be written to fill down the dates that the summary level is displaying, which are essentially the min and max dates of the groups.  
    I could do this pretty easily in excel but I have over a 100 projects and doing the import one at a time is not feasible.
    I could create LOE’s but as my variables are constantly changing and due to the volume also not an option.
    Summary bars are not an option eithers as I am writing the UDF’s to get all the bars I want on one line, 
    An option for me might be to do it using Legare but I would prefer to see if I can get it done in P6 first.
    Cheers
    Rob

    Yes, you can do it in one report.
    I created a sample report from efashion:
    Year | Lines | Sales Revenue
    2001 | Accessories | $250
    2003 | Accessories | $550
    2001 | City Skirts | $1050
    2003 | City Skirts | $1150...........
    Create 2 variables 1) Count and 2) Difference:
    1) Count  as formula - =Count([Lines]) In Report
    2) Difference as formula - =Sum([Sales revenue]) Where (Max([Year]) In Report = [Year]) - Sum([Sales revenue]) Where (Min([Year]) In Report = [Year])
    You can replace the formula with your report variables. Then just drag Site ID, Count and Difference variables to your report.
    Thanks
    Jai

  • Find out the MIN & MAX of DATE QUARTERWISE

    Hi All ,
    I need to find out the MIN & MAX of DATE for QUARTEWISE by using SQL Only . How we can do it ? if anybody knows Please revert me .
    Thanx in Advance
    Bye

    SQL> select deptno,
    2  to_char(trunc(hiredate,'q'),'YYYY"Q"Q'),
    3  to_char(min(hiredate),'DD.MM') MIN,
    4  to_char(max(hiredate),'DD.MM') MAX
    5  from emp
    6  group by deptno, trunc(hiredate,'q');
        DEPTNO TO_CHA MIN   MAX
            10 1981Q2 09.06 09.06
            10 1981Q4 17.11 17.11
            10 1982Q1 23.01 23.01
            20 1980Q4 17.12 17.12
            20 1981Q2 02.04 02.04
            20 1981Q4 03.12 03.12
            20 1987Q2 19.04 23.05
            30 1981Q1 20.02 22.02
            30 1981Q2 01.05 01.05
            30 1981Q3 08.09 28.09
            30 1981Q4 03.12 03.12

  • How to get min,max,avg time for query execution?

    Dear Friends,
    In AWR we are getting avg time taken to execute particular query, how can one get min,max time taken by query during number of executions.
    Thanks

    I would run the sql in a cursor for loop, to get a quite reasonable execution time without changing the actual execution plan:
    SQL> show user;
    USER is "HR"
    SQL> set timing on
    SQL> select count(*) from all_objects;
      COUNT(*)
         55565
    Elapsed: 00:00:03.91
    SQL> var p_sql varchar2(200)
    SQL> exec :p_sql := 'select * from all_objects'
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> declare
      2  t1 timestamp := systimestamp;
      3  begin
      4    execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
      5    dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.53
    SQL> declare
      2  t1 timestamp := systimestamp;
      3  begin
      4    execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
      5    dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.75
    SQL> declare
      2  t1 timestamp := systimestamp;
      3  begin
      4    execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
      5    dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.73
    SQL> declare
      2  t1 timestamp := systimestamp;
      3  begin
      4    execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
      5    dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.66
    SQL> ---- alter system flush shared_pool;
    SQL> declare
      2  t1 timestamp := systimestamp;
      3  begin
      4    execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
      5    dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.80
    SQL> declare
      2  t1 timestamp := systimestamp;
      3  begin
      4    execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
      5    dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.64
    SQL>
    https://forums.oracle.com/thread/705536?start=15&tstart=0
    Regards
    Girish Sharma

  • Time phase Min/max replenishment models for future dates

    Hi,
    We are working on a safety stock requirement of Maximum/Minimum replenishment model in APO.
    It seems to work great except it cannot be time phased.  Our business wants different safety stock strategies at different times of the year. 
    Please suggest if there is a way that we could “time phase” min/max replenishment models for future dates?
    Thanks in advance for your help!
    regards
    Yogendra

    Many thanks for this.
    I can see entirely why it's designed as such, but I just find it slightly frustrating that there's no way to break the link between the order and the shipment out to the depot. Just to clarify, we're not requiring the orders to change - they will still be made and will come in - but just that the orders themselves don't specifically need to be the stock that is used for the replenishment.
    So -
    1. Min Max identifies depot needs replenishing.
    2. Central distribution does not have (enough) stock to replenish.
    3. Order is made to replenish central distributions stock.
    4. We ship whatever we've got, when we've got it, to depot to replenish.
    It's the bit where Min-Max is trying to replensih a specific depot rather than our central distribution centre that's my problem.
    I suspect that, as you say, that specific issue is not directly fixable without getting our IT contractors to do a customisation.
    I'm going to look into your Supply Date Offset suggestion now, though I'm not sure how this affects the shipping after the orders are placed. The orders themselves are approved manually after we've checked our stock position (i.e. what's in with the recycling team), but we recycle & refurb probably 60% of our maint stock so there'll always be kit turning up after the order has been made because of the long lead times.
    Thanks again.

  • Finding difference between Max date and Min date from single date field

    Dear Experts,
    Here I am with a scenario where i didnt find any solution in SDN and in most threads it is unanswered.
    I have 1 KF which is a date field. With reference to Serial no, I want to find out the Max and Min date from the same KF. I created 2 CKF where the same KF is used in both CKF to find the Min and Max dates,
    Ex:
    Serial No | Material | Actual Del date | Max | Min | Difference
    0123 | 300012 | 01.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0123 | 300013 | 07.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0123 | 300018 | 15.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0123 | 300014 | 30.01.2009 | 31.01.2009 | 01.01.2009 | 30
    0124 | 300019 | 02.01.2009 | 10.01.2009 | 02.01.2009 | 8
    0124 | 300012 | 06.01.2009 | 10.01.2009 | 02.01.2009 | 8
    0124 | 300017 | 10.01.2009 | 10.01.2009 | 02.01.2009 | 8
    This is the way how I want the output where now I am able to get the values right till Max and Min and not the difference. I even created the 3rd CKF the find the difference but it is not working.
    How can I find the difference between the Max and Min dates?
    Regards,
    Chan

    Hi
    You have FM --DAYS_BETWEEN_TWO_DATES you can use this while Customer Exit.
    Try to Have 2 RKF for Min Data and Max Date and create a formula/CKF on the same ..
    Hope it helps

  • Min Max Planning data uploading

    Dear All
    I have task to upload about more than 4000 items in form form Min Max Planning.
    I just wanted to ask that if i upload the data directly from excel into its table.
    Is it going to make any harm.
    Its main table name is MTL_ITEM_SUBINVENTORIES
    Requirement is urgnent there for waiting for your reply desperetely.
    Majid

    Hi Majid,
    Never update data in a table directly ... you could run into support issues with Oracle. Unless you use a public api or interface. Or be 100% that you have validated your data properly before loading i.e. Item codes, are they assigned to the relevant INV org that the subinventory belongs to etc. etc.
    For your particular issue you could use a form loader tool such a dataload.net. It is available as a freeware version (classic) that supports loading from spreadsheet to an open form or a professional version where you use a prerecording and 'background' load for more dataintensive requirements. It is still emulating datamanipulation as if it is done through a form.
    Using a loader will ensure that your data is validated properly.
    /Niels LM

Maybe you are looking for

  • IPod Touch 4G Alarm Volume

    I just purchased a new 4G Touch and got it all set up with the data from my 3G and noticed right away that the volume for the clock alarm was about half as loud as the 3G. I remember hearing of issues with the alarm due to the setting for the new yea

  • FORMAT C DRIVE

     I have hp Pavilion 15-n209TX, I already created recovery disk (5 disk), and also there is 1 drive name as recovery disk, i just want to know how to format my C DRIV E ONLY using R-disk or R-drive? and i also want to know how to split DRIVERS ONLY fr

  • Need some help with this code.

    var myDoc = app.documents[0] var mySel = app.selection[0] var myStory = mySel.parentStory; // Now we are pointing to the entire story var myHolidayStyle1 = "Holiday-Header" // Header 'day of the week' var myHolidayStyle2 = "Holiday-Sub-Heading-Date"

  • Trying to get assistance witha reimbursement

    I was charge $95.33 and $21.31 on 8 Sep 14, I called immediately and informed your business that I need a stop and reimburse, you told me no problem, but to this date I still missing a $95.33 payment. I have copy of my bank transaction report were it

  • Adobe flash crashes only in Firefox.

    This is driving me nuts. Adobe flash crashes every time in multiple sites. I have reset Firefox, uninstalled every add on to test them. Right now there are no add on's (post resetting Firefox). Going down the list of fixes here: https://support.mozil