How can I get max, min & average (hours with minutes) of fast 30 days data

Table name:
run_log
TYPE VARCHAR2(10),
SUBTYPE VARCHAR2(10),
PROGRAM VARCHAR2(100),
STATUS VARCHAR2(20),
START_TIME      DATE,
END_TIME      DATE
How can I get max, min & average (hours with minutes) of fast 30 days data ?

Hi,
you have to use analytical functions:
SELECT start_day,
       round(AVG(daily_avg)
             over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_avg,
       round(MAX(daily_max)
             over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_max,
       round(MIN(daily_min)
             over(ORDER BY start_day ASC RANGE BETWEEN INTERVAL '30' DAY preceding AND INTERVAL '0' DAY following)) AS moving_min
  FROM (SELECT trunc(t.start_time) start_day,
               AVG((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_avg,
               MAX((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_max,
               MIN((t.end_time - t.start_time) * 24 * 60 * 60) AS daily_min
          FROM run_log
         GROUP BY trunc(t.start_time)) t
ORDER BY 1 DESCAnalytical functions are described in the Oracle doc "Data Warehousing Guide".
Regards,
Carsten.

Similar Messages

  • I have an Retina display MacBook Pro with HMDI out port. I also have an HDMI to Component cable with Audio Plugs. How can I get HDMI out to work with this cable when plugged into the Component and Audio ports on my TV?

    I have an Retina display MacBook Pro with HMDI out port. I also have an HDMI to Component cable with Audio Plugs. How can I get HDMI out to work with this cable when plugged into the MacBook Pro and connected to the TVs Component and Audio in ports.

    Will not work.  To my knowledge, dual converting like that isn't supported.  The Mac must detect the connected video output device and that sort of info cannot be done across an analog component uni-directional connection.

  • I have multiple email accounts.  One is a google email and another aol.  I have the aol going into my google.  I Now Go Lead Generate! Am using outlook on my pc.  How can I get my outlook to share with my ipad?

    I have multiple email accounts.  One is a google email and another aol.  I have the aol going into my google.  I Now Go Lead Generate! Am using outlook on my pc.  How can I get my outlook to share with my ipad?

    In Mail Preferences/Accounts/each GMail account, set up the SMTP Outgoing Server for each account separately, going into SMTP name/edit/Advanced and specify the Username of each account.  The Outgoing servers must be two different servers, authenticated by the Username and Password of each.
    Otherwise, the GMail SMTP server will change the from address to that of the account where the SMTP server was setup.
    Ernie

  • I imported a slide on my old mac book pro to my iTune i had on it, but it got a new one how can i get my old iTune  back with that slide i imported

    imported a slide on my old mac book pro to my iTune i had on it, but it got a new one how can i get my old iTune  back with that slide i imported

    If this is a question about syncing with iTunes, you might want to post it over in the iTunes forum.

  • How can I get a single jar file with NetBeans?

    How can I get a single jar file with NetBeans?
    When I create the project I get these files:
    dist/lib/libreria1.jar
    dist/lib/libreria2.jar
    dist/software.jar
    The libraries that have been imported to create the project are in separate folders:
    libreria1/libreria1.jar
    libreria2/libreria2.jar
    libreria1, libreria2, dist folders are all located inside the project folder.
    I added the following code to the build.xml:
    <target name="-post-jar">
    <jar jarfile="dist/software.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria1.jar" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria2.jar" excludes="META-INF/*" />
    <manifest>
    <attribute name="Main-Class" value="pacco.classeprincipale"/>
    </manifest>
    </jar>
    </target>
    Of course there is also the project folder:
    src/pacco/classeprincipale.form
    src/pacco/classeprincipale.java
    Can you tell me what is wrong? The error message I get is as follows:
    C:...\build.xml:75: Problem creating jar: archive is not a ZIP archive BUILD FAILED (total time: 2 seconds)

    This is not a NetBeans forum, it is a JDeveloper forum. You might want to try http://forums.netbeans.org/. I also saw your other question - try looking in the New to Java forum: New To Java

  • How can I get a picture to go with my email signature when sending emails from my iPad? Only a square box shows up on my signature not the actual picture I iploaded in my settings.

    How can I get a picture to go with my email signature when sending emails from my iPad? Only a square box shows up on my signature not the actual picture I iploaded in my settings.

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • How can we get the value of the key field in a custom data model using governance API?

    Dear Team,
    How can we get the value of the key field in a custom data model, to be used for manipulation of the change request fields using governance API?
    Any kind of help would be sincerely appreciated.
    Thanks & Regards,
    Tushar.

    Hi Michael,
    Thanks for direction. Let me give more context on this as I'm interested to get more details..One of the issue was to read cross entity field values on UI based on user action and set other entity field behaviour...It is similar to what is being posted here.
    For ex: Reading MTART from Basic Data UIBB in MM MDG UI and set the field properties in some other custom entities say ZZETEST. This cannot be done using UI BADI as it only supports single entity at a time and not cross entity. So alternatively we found a solution where we can enhance existing PLMB feederclass cl_mdg_bs_mat_feeder_form by reading the model and the entity as needed as it it proved that it supports cross entity UI field behaviours and so business requirements.
    This is a workaround for now.
    So the question is How do we achive it using governance API for cross entity field behiaviours.?or what is the right way doing this.
    Can we do that using governance API and its' methods?
    In the Governance API doc you provided below has referring to below external model as part of gevernance API.
    The active or inactive data (before or during the derivation or the check) can be read
    with the external data model interface IF_USMD_MODEL_EXT with the method READ_CHAR_VALUE and
    the corresponding READ_MODE parameter. To avoid unnecessary flushes (derivations), the NO_FLUSH
    parameter should b
    e set to ‘X’.
    Thanks
    Praveen

  • I reinstalled my OS and now it wants to empty my phone.  How can I get it to back up my phone without removing the data?

    I reinstalled my OS and now it wants to empty my phone.  How can I get it to back up my phone without removing the data?

    You can't. But if you backed up your computer prior to wiping it out, you should be able to restore your iTunes library, contacts, photos, etc. from that backup. Once you do, you can set the phone up again and just sync everything from your library back to it.
    If you didn't back the computer up either, you can transfer items purchased on the phone into iTunes, and if you set up at least one contact in whatever application you sync your contacts to on the computer, it will offer to merge the address books on the first sync, saving those.  Any media you'd acquired from sources other than the iTunes store will have to be re-downloaded from the source or re-ripped.
    The iPhone is NOT a backup device.

  • How can I get my ipod to work with itunes?

    When I connect my ipod classic into my new computer it seems that itunes does not recognize it. How can I get my ipod to work with itunes? I'm afraid to disconnect my ipod because the display is saying Do Not Disconnect.

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • When I select a title in the iTunes Store and click on Play in iTunes I am sent to the download page for iTunes 10 which I have already. The selected title cannot be found anywhere in my iTunes. How can I get the title in iTunes with possibility to buy it

    When I select a title in the iTunes Store and click on Play in iTunes I am sent to the download page for iTunes 10 which I have already. The selected title cannot be found anywhere in my iTunes. How can I get the title in iTunes with possibility to buy it?

    The issue is that your credit or debit card credentials must be associated with the same country where you reside in order to purchase iTunes content.
    "Although you can browse the iTunes Store in any country without being signed in, you can only purchase content from the iTunes Store for your own country. This is enforced via the billing address associated with your credit card or other payment method that you use with the iTunes Store, rather than your actual geographic location. You can use the iTunes Store in all countries of which you’re a resident, but you’ll either need a separate iTunes Store account for each one, or you’ll need to continually be switching the billing information on your single account. Generally, it’s simpler just to set up an alternative account for these situations, although it’s worth nothing that features like iTunes in the CLoud and iTunes Match are designed to work best when using a single iTunes Store account, as you can only switch accounts with these services every 90 days."
    From here >  The Complete Guide to Using the iTunes Store | iLounge Article

  • How can i get my verizon bill bundled with century link?

    how can i get my verizon bill bundled with century link?

    Call CenturyLink and they can combine the two bills.

  • How can I get the digital booklet included with the albums I am purchasing from iTunes directly on my iPad?

    How can I get the digital booklet included with the albums I am purchasing from iTunes directly on my iPad?  My MacBook died about 6 months ago, so now I just have an iPhone and iPad.  I would like to be able to see the Digital Booklet in my iPad when I download the album.  I do not have any other computer to download the booklet to and sync to my iPad.

    Apparently, you have to download the booklet to iTunes on a computer first, fiddle with the file type, then sync it as a book to your iPad. See http://support.apple.com/kb/HT4194 for details.

  • How can I get my notes to sync with mac in iCloud

    How can I get my notes to sync with mac in iCloud ?

    Hey there Willard,
    Welcome to Apple Support Communities.
    This article will answer your question about syncing Notes on your iPad and your Mac with iCloud.
    Syncing Notes on iPhone, iPad, and iPod touch - Apple Support
    Take care,
    -Jason

  • How can I get interactive websites to work with Firefox?

    In the last week many of the interactive websites I've been using for years suddenly stopped working properly. However they do work with Internet Explorer. How can I get them to work again with Firefox?

    In what way are those websites not working?
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How can I get elements 11 to work with 16 bits photos?

    In the expert mode of Photoshop Elements 11, I can only work with 8 bits photos. How can I get Elements 11 to work with 16 bits photos?

    No, you can still buy photoshop cs6 (perpetual license) if one doesn't want to subscribe to the cloud version (photoshop cc version 14)
    Either way is expensive compared to photoshop elements.
    http://www.adobe.com/products/cs6.html?promoid=JOLIS

Maybe you are looking for

  • [SOLVED] Openbox autostart no longer working since upgrade

    After the upgrade on May 14 2013 my autostart file no longer works. I tried renaming my autostart.sh to just autostart no luck. There is nothing wrong with the autostart file as I can run it manually and it will load all my apps. Also, if I cd to  /u

  • Creation of Purchase Requisition using BAPI

    Hi Experts Can anyone provide me the sample code for creating Purchase Requisition using BAPI Thanks in advance

  • Why aren't audio files visible individually in the timeline?

    It seems like this would be helpful. But I could, as always, be oh-so-wrong! Thanks.

  • System won't boot-no chime.

    Despite repeated attempts and resetting the CUDA button, the system won't boot when start button is pressed. In the first few seconds it seems to make normal sounds; but no chime and settles into simply fan noise. This is true even if using C (with a

  • Downsides of changing owner name, Long and short?

    I have a bunch of Macs and I am thinking of changing their names both the "official" long name and the nickname (short) name. With Leopard it is now possible to change not only the short name but also the home directory and even user and group ids (5