Group by 30 min interval

Hello
I have data like below in my table formate. Here the time is varchar field.

Time Date KPI1 KPI2
2010-09-28 10:00 40 38
2010-09-28 10:15 30 30
2010-09-28 10:30 17 17
2010-09-28 10:45 17 17
2010-09-28 11:00 29 29
2010-09-28 11:15 25 23
2010-09-28 11:30 24 23

My requirement is (how will get this values)


Time Date KPI1 KPI2
2010-09-28 10:00 40 38
2010-09-28 10:30 47 47
2010-09-28 11:00 46 46
2010-09-28 11:30 49 46

In this condition I can reach level administrator or response. If it is possible
explain me the step by step function

Thank you

Published by: 816377 on December 16, 2010 20:39

Published by: 816377 on December 16, 2010 21:13

Published by: 816377 on December 16, 2010 21:14

try something like this

TIMESTAMPADD (SQL_TSI_MINUTE, BOX WHEN MINUTE (DATETIMESTAMP_COLUMN)< 30="" then="" 30-minute(datetimestamp_column)="" else="" 60="" -="" minute(datetimestamp_column)="" end,="">

Tags: Business Intelligence

Similar Questions

  • Connection Bluetooth AV auto - less than 1 min interval?

    Hi all.
    Thank you for reading my post.

    Finally, bluetooth stack 7.0 supports the AV auto interval option.
    The shortest time is 1 min., but I would first of all like 10s or 20s.

    Is it possible?
    Thank you for reading.

    Hello

    I'm not sure if this is possible
    Is there is no such settings then I suppose that the shortest time is adjustable only 1 min.

    See you soon

  • Bluescreens ~ 15 min interval... 0X0000009F DRIVER_POWER_STATE_FAILURE

    Hi I'm Philipp,

    and I hope you can help me with this problem:

    My system is a Win7 64 bit old for two months on a Toshiba Tecra Notebook z50. During the first-updates Windows appears the first Bluescreen.

    I tried to solve the problem 0x0000009f DRIVER_POWER_STATE_FAILURE, but actually I get stuck.

    I trie to identify the driver, which seems to cause the problem.

    The Dumpfile indicates the following:

    ==================================================
    Dump file: 060315-10764 - 01.dmp
    Time of the accident: 03.06.2015 15:34:29
    Bug Check String: DRIVER_POWER_STATE_FAILURE
    Bug check code: 0x0000009f
    Parameter 1: 00000000'00000003
    Parameter 2: fffffa80 107 c 0970
    Parameter 3: fffff800'00b9e3d8
    Parameter 4: fffffa80'0d88fc60
    Caused by the driver: ntoskrnl.exe
    Caused by the address: ntoskrnl.exe + 75bc0
    File description: NT kernel & system
    Product name: Microsoft® Windows® Operating System
    Company: Microsoft Corporation
    File version: 6.1.7601.18409 (win7sp1_gdr.140303 - 2144)
    CPU: x 64
    Plant address: ntoskrnl.exe + 75bc0
    Stack address 1:
    The stack address 2:
    Address 3 the battery:
    Computer name:
    Full path: C:\Windows\Minidump\060315-10764-01.dmp
    Number of processors: 4
    Main version: 15
    Minor Version: 7601
    Empty the file size: 1.027.896
    Dump of file time: 03.06.2015 15:35:27
    ==================================================

    Thanks for your support,

    Regards Philipp

    Also the link to the minidump and MSinfo32:

    https://onedrive.live.com/redir?RESID=9F39027DBFE5299D! 109 & authkey =! ACdpcx4LGKdn_1k & ithint = the file % 2czip

    They are all connected to iusb3hub.sys driver hub USB 3.0 of Intel Corporation.  Remove the driver current completely and install the latest driver available.

  • sum of 5 min of the County group

    Hello

    I'm looking for a sum of count of status by group of 5 min from date-time data.

    I have the table table1 with date columns, status (1) tank update_datetime

    The one you suggest a solution for this? Thanks in advance.

    I have a request, but to change to get the sum of group status by 5 min.

    SELECT update_datetime, decode(status,'1','SUBMITTED') State, COUNT (1)
    OF test1
    "WHERE to_char (update_datetime, 'dd-mon-yyyy hh24:mi:ss') > = 24 January 2010 14:00.
    "and to_char (update_datetime, 'dd-mon-yyyy hh24:mi:ss') < 24 January 2010 14:16.
    AND status = '1'
    GROUP BY update_datetime, status
    order update_datetime;

    STATUS OF UPDATE_DATETIME
    -------------------- -------
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:00 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:01 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:02 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:03 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:04 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:05 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:06 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    2010-01-24 14:07 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    24/01/2010 14:08 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:09 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:10 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:11 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    2010-01-24 14:12 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    24/01/2010 14:13 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    2010-01-24 14:14 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    24/01/2010-14:15 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1
    2010-01-24 14:16 1

    Published by: SDS on February 3, 2010 11:18

    The fact is - and I thought it was pretty obvious - was that you have to change what you are selecting and group by.
    I did not have your tables and data, as is normal around here, I have illustrated with a reproducible example, standalone to show the rough concept and hoped that you would move yourself forward.

    Thus, instead of

    SELECT update_datetime ...
    ....
    GROUP BY update_datetime, status
    ORDER BY  update_datetime;
    

    You should do something like

    SELECT TRUNC(update_datetime) + TRUNC(TO_CHAR(update_datetime,'SSSSS')/300)/12/24  ...
    ....
    GROUP BY TRUNC(update_datetime) + TRUNC(TO_CHAR(update_datetime,'SSSSS')/300)/12/24, status
    ORDER BY  TRUNC(update_datetime) + TRUNC(TO_CHAR(update_datetime,'SSSSS')/300)/12/24;
    
  • Missing time based interval readings out

    I'm using oracle 11.2.0.1 Enterprise Edition. And I tried write differently query but unable to go there. Your help is greatly appreciated.

    The query should give out as I explained below.

    This request is to identify gaps in the readings of the interval.

    This is my creation script.
    create table rtype)
    rid the number,
    RDesc varchar2 (30));

    insert into rtype values (1, 5-deviceinterval');
    insert into rtype values (2, 15-deviceinterval');

    create table (reads
    number of DEVICE_ID,
    rid the number,
    number of qstartid
    number of qfinishid
    number of ReadValue,
    date of readtimestamp);

    Insert in the values of readings (123, 1, null, null,.951, to_date (May 1, 2012 00:00:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.51, to_date (May 1, 2012 00:05:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.51, to_date (May 1, 2012 10:00:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.51, to_date (May 1, 2012 15:00:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.51, to_date (May 1, 2012 20:00:00 "," mm/dd/yyyy HH24:MI:SS));))

    Insert in the values of readings (123, 1, null, null,.51, to_date (May 1, 2012 01:00 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.61, to_date (May 1, 2012 01:05 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.41, to_date (May 1, 2012 01:10 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.31, to_date (May 1, 2012 01:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.23, to_date (May 1, 2012 01:20 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.69, to_date (May 1, 2012 01:25 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.85, to_date (May 1, 2012 01:30 ',' mm/dd/yyyy HH24:MI:SS));))

    Insert in the values of readings (123, 1, null, null,.51, to_date (May 1, 2012 02:10 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.61, to_date (May 1, 2012 02:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.41, to_date (May 1, 2012 02:20 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, 1, null,.31, to_date (May 1, 2012 02:25 ',' dd/mm/yyyy HH24:MI:SS));))

    Insert in the values of readings (123, 1, null, 1,.23, to_date (May 1, 2012 03:20 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null, 2.23, to_date (May 1, 2012 03:25 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123, 1, null, null,.23, to_date (May 1, 2012 03:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 16.71, to_date (May 1, 2012 01:00 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 17.81, to_date (May 1, 2012 01:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 191.11, to_date (May 1, 2012 01:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 221.11, to_date (May 1, 2012 01:45 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 61.71, to_date (May 1, 2012 02:00 "," mm/dd/yyyy HH24:MI:SS));))

    Insert in the values of readings (123.2, null, null, 71.81, to_date (May 1, 2012 03:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 911.11, to_date (May 1, 2012 03:30 ',' mm/dd/yyyy HH24:MI:SS));))

    Insert in the values of readings (123.2, null, null, 121.11, to_date (May 1, 2012 04:45 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 61.71, to_date (May 1, 2012 05:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 72,81, to_date (May 1, 2012 05:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (123.2, null, null, 941.11, to_date (May 1, 2012 05:30 "," mm/dd/yyyy HH24:MI:SS));))

    Insert in the values of readings (456,2, null, null, 6.71, to_date (May 1, 2012 01:00 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 7.81, to_date (May 1, 2012 01:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 91.11, to_date (May 1, 2012 01:30 ',' mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 121.11, to_date (May 1, 2012 01:45 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 6.71, to_date (May 1, 2012 02:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 7.81, to_date (May 1, 2012 03:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2,1, null, 91.11, to_date (May 1, 2012 03:30 ',' mm/dd/yyyy HH24:MI:SS));))

    Insert in the values of readings (456,2, null, 1, 121.11, to_date (May 1, 2012 04:45 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 6.71, to_date (May 1, 2012 05:00 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 7.81, to_date (May 1, 2012 05:15 ',' dd/mm/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 91.11, to_date (May 1, 2012 05:30 "," mm/dd/yyyy HH24:MI:SS));))
    Insert in the values of readings (456,2, null, null, 121.11, to_date (May 1, 2012 06:45 ',' dd/mm/yyyy HH24:MI:SS));))

    commit;

    I would like to get an output like below. I have billions of records in the table of readings, and so would have good performance.
    As you can see rtype 1 5 minutes reading interval and rtype 2 is 15 minutes to the reading of time interval.
    Expected output as below.

    DEVICE_ID rtype missing_interval_date_time Qty.
    123 1 05/01/2012 00:30:00
    123 1 05/01/2012 00:35:00
    123 1 05/01/2012 00:40:00
    123 1 05/01/2012 00:45:00
    .
    .
    123 1 05/01/2012 00:55:00

    123 1 01:35 05/01/2012
    123 1 05/01/2012 01:40
    123 1 05/01/2012 01:45
    .
    .
    123 1 02:05 05/01/2012
    123 1 05/01/2012 02:30 1 - since the data on quality starts with qstartid
    123 1 05/01/2012 02:35 1
    123 1 05/01/2012 02:40 1
    123 1 05/01/2012 02:45 1
    .
    .
    123 1 05/01/2012 03:15 1 - data end with qendid quality
    123 1 05/01/2012 03:35
    123 1 05/01/2012 03:40
    .
    .
    123 1 23:55 05/01/2012
    123 2 05/01/2012 00:00:00-(same for the device_id even another rtype with 15 min interval)
    123 2 05/01/2012 00:15:00
    123 2 05/01/2012 00:30:00
    123 2 05/01/2012 00:45:00

    123 2 05/01/2012 02:15
    123 2 05/01/2012 02:30
    123 2 05/01/2012 02:45
    123 2 05/01/2012-03:00

    123 2 05/01/2012 03:45
    123 2 05/01/2012-04:00
    123 2 05/01/2012-04:15
    123 2 05/01/2012-04:30

    123 2 05/01/2012 05:45
    123 2 05/01/2012 05:50
    .
    .
    123 2 23:30 05/01/2012
    123 2 05/01/2012 23:45
    456...



    Basically, there are two rtypes, there are 5 minute interval and has another 15 minutes.

    so, as you can see that missing intervals between below two bed 1st may 2012 00:25:00 ' and may 1, 2012 01:00 ' should be as below since its data every 5 minutes based on rtype = 1

    123 1 05/01/2012 00:30:00
    123 1 05/01/2012 00:35:00
    123 1 05/01/2012 00:40:00
    123 1 05/01/2012 00:45:00
    .
    .
    123 1 05/01/2012 00:55:00

    Similarly the readings between two bed 1st may 2012 02:00:00 ' and may 1, 2012 03:15 ' should be as below since its data every 15 minutes based on rtype = 2

    123 2 05/01/2012 02:15
    123 2 05/01/2012 02:30
    123 2 05/01/2012 02:45
    123 2 05/01/2012-03:00

    And

    When qstartid 1, means it lacks data range because there are certain quality. So, we just need to point out that these interval data missing due to the quality indicator observed. He has qstartid = 1 means quality reading beginning qfinishid = 1, end of quality data.

    The next part is ends and housing starts of flag of quality. Which means that if there is some other readings such as device failure may cause missing intervals, then in this case, its valid missing intervals and we need to mark that data, so we can not consider as a real lack of range, but its missing due to the interruption intervals, so we need to identify this piece of interval missing due to the quality indicator.
    When qstartid 1, means it lacks data range because there are certain quality. So, we just need to point out that these interval data missing due to the quality indicator observed. He has qstartid = 1 means quality reading beginning qfinishid = 1, end of quality data.



    Insert in the values of readings (123, 1, 1, null,.31, to_date (May 1, 2012 02:25 ',' dd/mm/yyyy HH24:MI:SS));))

    Insert in the values of readings (123, 1, null, 1,.23, to_date (May 1, 2012 03:20 ',' dd/mm/yyyy HH24:MI:SS));))

    Lack of exit of the interval should be

    123 1 05/01/2012 02:30 1 - since the data on quality starts with qstartid
    123 1 05/01/2012 02:35 1
    123 1 05/01/2012 02:40 1
    123 1 05/01/2012 02:45 1
    .
    .
    123 1 05/01/2012 03:15 1 - data end with qfinishid quality



    ------------------------------------------------------
    I tried several combinations, including after one, but impossible to go
    Select missing all_dates.d
    de)
    Select to_date ('20120501 00:00:00 ', 'YYYYMMDD HH24:MI:SS')-1 + rownum of double d
    connect by level < = 15) all_dates, reading x
    where all_Dates.d = x.readtimestamp (+)
    and x.readtimestamp is null
    order of all_dates.d
    /

    ---------------------------------------------------------

    >
    If possible, can you please give me a plsql sample code to do this?
    >
    Of course - see below.

    Hear about. For the collection of data like yours there is used when the collection process is serial in nature. For these cases, it may be useful data collection "missing time" at the time where the actual data are inserted in the database rather than trying to recreate both later. Which may or may not be possible in your situation.

    For an example using FORALL with INSERT see example 12-3 issuance of INSERT queries in a loop in the Doc of the PL/SQL language
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/tuning.htm#BABEDFJE

    Here is a simple example of using BULK COLLECT with a LIMIT clause. You conducts experiments with the code using the SCOTT schema to get an idea of how this works. Normally, you would use a variable or a parameter for the value LIMIT.

    EXTRACTION is a BULK of COLLECTING all the data in "v". It will get either all data, or none if there is none.

    The construction of the LOOP would be used when you have a LIMIT clause while Oracle would be 'loop' return to
    Download the following Recordset. Run this example in the SCOTT schema and you will see how the LIMIT clause.
    I have 14 records in my table EMP.

    DECLARE
      CURSOR c1 IS (SELECT * FROM emp);
      TYPE typ_tbl IS TABLE OF c1%rowtype;
      v typ_tbl;
    BEGIN
      OPEN c1;
      LOOP                                                 --Loop added
        FETCH c1 BULK COLLECT INTO v LIMIT 3; -- process 3 records at a time
            -- process the first 3 max records
           DBMS_OUTPUT.PUT_LINE('Processing ' || v.COUNT || ' records.');
            FOR i IN v.first..v.last LOOP
                DBMS_OUTPUT.PUT_LINE(v(i).empno);
            END LOOP;
        EXIT WHEN c1%NOTFOUND;
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('All done');
    END;
    

    In the loop, you would do any processing of the nested table, you want to make
    and could use a FORALL do one INSERT into another table.

  • Group by date with time lag

    Hello

    my table has the following columns: mydate DATE and myval NUMBER.
    I have data in the hourly resolution, ex:
    MyDate myval
    2008-01-01 00:00 123
    2008-01-01 01:00 456
    01/01/2008 02:00 454
    .......
    2008-01-01 23:00 345
    2008-02-01 00:00 445
    2008-02-01 01:00 878
    ....

    I need to get the sum of myval for every day, but a day of 24 hours from 06:00 until 05:00 the next day.

    the result should look like this
    sum of day
    01/01/2008 454354
    2008-02-01 34545
    2008-03-01 345343
    .....

    the first line (day 01/01/2008) is the sum of 01/01/2008 06:00 until 05:00 01/02/2008.
    the second row (day 01/02/2008) is the sum of 01/02/2008 06:00 until 05:00 01/03/2008.
    and so on...

    the SQL code I've written is:
    Select to_date(mydate,'dd/MM/yyyy'), sum (myval)
    FROM MyTable
    to_date(mydate,'dd/MM/yyyy') group

    but it gives me to each line of the somme for the day from 00:00 to 23:00, and not what I need.
    SQL> create table mytable (mydate,myval)
      2  as
      3  select to_date('01/01/2008 00:00','dd/mm/yyyy hh24:mi'), 123 from dual union all
      4  select to_date('01/01/2008 01:00','dd/mm/yyyy hh24:mi'), 456 from dual union all
      5  select to_date('01/01/2008 02:00','dd/mm/yyyy hh24:mi'), 454 from dual union all
      6  select to_date('01/01/2008 23:00','dd/mm/yyyy hh24:mi'), 345 from dual union all
      7  select to_date('02/01/2008 00:00','dd/mm/yyyy hh24:mi'), 445 from dual union all
      8  select to_date('02/01/2008 01:00','dd/mm/yyyy hh24:mi'), 878 from dual union all
      9  select to_date('02/01/2008 05:00','dd/mm/yyyy hh24:mi'), 878 from dual union all
     10  select to_date('02/01/2008 06:00','dd/mm/yyyy hh24:mi'), 878 from dual union all
     11  select to_date('02/01/2008 07:00','dd/mm/yyyy hh24:mi'), 878 from dual
     12  /
    
    Tabel is aangemaakt.
    
    SQL> select to_char(trunc(mydate - interval '6' hour),'dd/mm/yyyy') "day"
      2       , sum(myval) "sum"
      3    from mytable
      4   group by trunc(mydate - interval '6' hour)
      5  /
    
    day                                           sum
    ---------- --------------------------------------
    31/12/2007                                   1033
    01/01/2008                                   2546
    02/01/2008                                   1756
    
    3 rijen zijn geselecteerd.
    

    Kind regards
    Rob.

  • Average read get-stat - virtualdisk.read.average stat?

    Hi all

    I want to use the metric virtualdisk.read.average to calculate the average read speeds per virtual disk to a virtual computer in the last 24 hours (using the 5 min interval)

    [1]

    I want to calculate the average in * every * instance and then add these individual averages until you get the desired amount.

    For example (using real-time output just for example only, I want 24 hours actually):

    MetricId unit Insta timestamp value
    NCE
    --------                ---------                          ----- ----     -----
    VirtualDisk.Read.Ave... 13/05/2011 19:39 6 Kbps scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:38:40 Kbps 11 scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:38:20 KBps 39 scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:38 431 Kbps scsi0:0
    VirtualDisk.Read.Ave... 13/05/2011 19:39 10 Kbps scsi0:1
    VirtualDisk.Read.Ave... 13/05/2011 19:38:40 Kbps 0 scsi0:1
    VirtualDisk.Read.Ave... 13/05/2011 19:38:20 5 kbps scsi0:1
    VirtualDisk.Read.Ave... 13/05/2011 19:38 0 Kbps scsi0:1

    Average (6 + 11 + 39 + 431) = 121.75

    average (10 + 0 + 5 + 0) = 3.75

    Total liked: 121.75 + 3.75 = 125,5

    What is the best way to achieve this? (Unfortunately there is no global instance as with the network and cpu.usagemhz parameters)

    [2]

    For the calculation of the IOPS / s, if you use the metric datastore.*, OR as the virtualdisk.*, is the following statement, 100% good:

    (a) virtualDisk.number [Read |] Write] Averaged.Average will calculate the OPS are / s generated by the virtual machine

    (b) disk.number [Read |] Write] .summation will calculate the OPS are / s that hit this particular data store (useful to see how busy is a data store - but will not provide any info on a single virtual machine (unless by chance, there is only a virtual computer on this data store special))

    [3]

    How to use virtualDisk.number [Read |] Write] calculate the IOPS / s for a given virtual machine?  Depending on the issue [1], to each VMDK, PAHO are / s on average individually and then add the averages for overall IOPS generated by this virtual machine in the last 24 hours?

    Concerning

    marc0

    Kind regards

    marc0

    [1] use the Group-Object and Measure-Object cmdlets for this.

    For example

    $vm = Get-VM MyVM $report = @()
    $stats = Get-Stat -Entity $vm -Stat virtualdisk.read.average -Start (Get-Date).AddHours(-12)
    $stats | Group-Object -Property Instance | %{
        $row = "" | Select Instance,Average
        $row.Instance = $_.Group[0].Instance
        $row.Average = ($stats | Measure-Object -Property Value -Average).Average
        $report += $row}
    $report $total = ($report | Measure-Object -Property Average -Sum).Sum
    Write-Host $vm.Name $total
    

    This will calculate the averages per virtual disk and add the averages together

    [2] see my post get PAHO are / s maximum .

    (a) Yes, provided that you add the OPS are / s for each virtual disk total

    (b) No, if you run the Get-Stat for an entity that is a virtual machine, you will get the statistics for this specific VM disk.

    The metric is available for HostSystem and VirtualMachine. See the column of the entity in the drive settings page.

    [3] Yes

  • Audio skipping on the Satellite L350

    I have problems with the audio on my Satellite L350.

    I bought it in February & for the first two months, I had no problem, but more recently I've been doing audio stuttering/vibrations/jump on my laptop.
    It always happens to intervals of 5 minutes for a few seconds on all the sound elements of my laptop - CD, DVD, winamp, iTunes, Windows media player, Media Player VLC, audio stream of Web sites, tones of warning if they happen be awakened at 5 min interval.

    I've seen some suggestions about this problem online like updating my audio drivers (I tried that & it didn't work), close all unesscesary programs, listen to music when I am not connected to the internet & the cnnection wireless on my laptop is off - none of them have worked.

    If someone else has had this provblem & is there a solution for this?

    Hello

    Hmm, I've never had or heard of this issue. I have the Satellite L300, which is similar to yours and I can't view t no problem with sound I even often listen music.

    In any case, noticed the same problem with external speakers too? I mean if you can determine if the internal speakers causing this problem or something else.
    Check it!

    In addition, I would recommend updated the BIOS you can find on the Toshiba site.
    And what OS are you using? You use the factory settings or you have installed another Windows?

  • time data between extraction using the database

    Hello

    I do datalogging with data 1 min interval, the logg data upward at 3 days, was preparing I use sql server, now I can't able to insert and extract data also plenty fast.  but I need to recover the data in the time specified and also a lot of wise.  could you tell me how to implement this?

    I downloaded a few vi ni.com, but his does not work...

    send me if possible example vi

    Hi DP Baro,

    See this link please

    http://vyaskn.tripod.com/searching_date_time_values.htm

    It shows how you can find date and time values. You can combine them. I don't really know if you can solve the interval of 5 minutes with her, but you can get definitifly the beach, you need. You can then filter the latest data in LabVIEW.

    See also this link for your second question

    http://www.mssqlcity.com/articles/compare/sql_server_vs_access.htm

    Mike

  • Update blackBerry 10

    I deleted the tweet, Linkin, and Facebook from my phone. After each deletion, I get the same update, re - install. I have no accounts of theses apps nor I want to get a. Why these applications cannot stay deleted and updated to avoid their reloading?

    Hello

    Unlike earlier versions of BB where 'shortcuts' were driven out, it seems that with BB10 full apps are forced upon us. But the solution is the same... to use an empty part of the home screen or create a group (I call mine "junk") and just move all these out of the way rather than delete them.

    For the moment, there is no "difficulty"... If all goes well in the future, this issue will be resolved. But for now, if you remove these, they will be re-pushed to you. It's just the way it is... for now.

    Good luck!

  • Cisco ISE comments Sponsor Isssue Portal

    Hi all

    We have insatalled 5 boxes of ise 3315 IOS 1.0.4 in our network where in two of them are admin node, two services strategy and has a node mnt. We using sponsor portal for guest user wirless comments where we integrated WLC 5508 with ise and using weblogin for guest users.

    We have created open ssid wlc and external aid redirected url to ise for the login page of comments.

    But when we create a guest in the sponsor for guest user connection, user that we faced after publication

    (1) when guest user gets connected to WiFi and connect to the portal of comments with credentials after putting the credentials then his new redirect to the same login page

    wihout invites successful connection.

    Can us guest login successful after comments connect to the portal of reviews or redirect any other link as google.com for guest user will be done the knowledge he is able to access the internet now

    (2) we have appointed time profile 8hours first user login guest. When the guest user gets connected while putting in credentials on the portal of comments.

    But we are facing problem after about 20 mins enhanced disconnects Internet and comments again Gets the login page of the portal of the guest and if we put the same credentials, then his work but after about 20 min interval disconnected Internet user.

    Can someone help me resolved on observation about covers them cisco ise comments sponsor Portal

    Thank you & best regards

    Pranav Gade

    Pranav your answers are online,

    (1) when guest user gets connected to WiFi and connect to the portal of comments with credentials after putting the credentials then his new redirect to the same login page

    wihout invites successful connection. When you use CWA (Central web authentication) there is no way we can redirect users by using the redirect url because it will always redirect users for each time they start a web request. There is no other cost functionality that will remove this condition because they have already been authenticated.  Here is a guide that explains the user experience when using web Central auth -

    http://www.Cisco.com/en/us/docs/security/ISE/1.1.1/user_guide/ise_guest_pol.html#wp1296954

    Can us guest login successful after login guest Portal comments or redirect any other link as google.com for guest user will be acquainted with it is able to access the internet now This is not possible, you can change the verbage and force the AUP to be displayed to users informing them that they can start their web request after hitting the button I accept.

    Here's to justify it experience, once users go through the process of reviews-

    http://www.Cisco.com/en/us/products/ps11640/products_configuration_example09186a0080ba6514.shtml#final

    (2) we have appointed time profile 8hours first user login guest. When the guest user gets connected while putting in credentials on the portal of comments.

    But we are facing problem after about 20 mins enhanced disconnects Internet and comments again Gets the login page of the portal of the guest and if we put the same credentials, then his work but after about 20 min interval disconnected Internet user. Check advance timer on your SSID you can be hitting the session on the WLC timeout. Please disable this option and let the functionality of COA ISE at expiration of the user on the controller sessions of.

    Thank you

    Tarik Admani
    * Please note the useful messages *.

  • GRE over IPSec tunnel cannot pass traffic through it

    I am trying to configure a GRE over IPSec tunnel between sites, we use the router cisco 7613 SUP720 (IOS: s72033-advipservicesk9_wan - mz.122 - 18.SXF15a.bin) and 3845 router (IOS:c3845 - advsecurityk9 - mz.124 - 25c.bin), we are facing problems when we use the tunnel because traffic is not passing through it. the configuration was working when we were using two routers cisco 3845 (IOS:c3845 - advsecurityk9 - mz.124 - 25c.bin), but for some reason, it doesn't work anymore when I paste the configuration on the new 7613 router.

    Head office

    crypto ISAKMP policy 10
    BA aes
    preshared authentication
    Group 5
    ISAKMP crypto key T3ST001 address 0.0.0.0 0.0.0.0
    !
    !
    Crypto ipsec transform-set IPSec_PLC aes - esp esp-sha-hmac
    transport mode
    !
    map PLC - CUM 10 ipsec-isakmp crypto
    defined by peer 167.134.216.89
    game of transformation-IPSec_PLC
    match address 100
    !
    !
    !
    Tunnel1 interface
    bandwidth 1984
    IP 167.134.216.94 255.255.255.252
    Mtu 1476 IP
    load-interval 30
    source of tunnel Serial0/1/0:0
    tunnel destination 167.134.216.89

    interface Serial0/1/0:0
    IP 167.134.216.90 255.255.255.252
    card crypto PLC - CUM

    access-list 100 permit gre 167.134.216.90 host 167.134.216.8

    Router eigrp 100
    network 167.134.216.92 0.0.0.3

    Directorate-General of the

    crypto ISAKMP policy 10
    BA aes
    preshared authentication
    Group 5
    ISAKMP crypto key T3ST001 address 0.0.0.0 0.0.0.0
    !
    !
    Crypto ipsec transform-set IPSec_PLC aes - esp esp-sha-hmac
    transport mode
    !
    map PLC - CUM 10 ipsec-isakmp crypto
    defined by peer 167.134.216.90
    game of transformation-IPSec_PLC
    match address 100

    Tunnel1 interface
    bandwidth 1984
    IP 167.134.216.93 255.255.255.252
    Mtu 1476 IP
    load-interval 30
    source of tunnel Serial1/0/0:1
    tunnel destination 167.134.216.90

    interface Serial1/0/0:1
    bandwidth 1984
    IP 167.134.216.89 255.255.255.252
    IP access-group 101 in
    load-interval 30
    no fair queue
    card crypto PLC - CUM

    access-list 100 permit gre 167.134.216.89 host 167.134.216.90

    ER-7600 #sh crypto isakmp his
    conn-id State DST CBC slot
    167.134.216.89 167.134.216.90 QM_IDLE 3 0

    ER-3845 #sh crypto isakmp his
    status of DST CBC State conn-id slot
    167.134.216.89 167.134.216.90 QM_IDLE 3 0 ACTIVE

    ER-3845 #sh active cryptographic engine connections

    Algorithm of address State IP Interface ID encrypt decrypt
    3 Serial0/1/0: 167.134.216.90 0 HMAC_SHA + AES_CBC 0 0 value
    3001 Serial0/1/0: 167.134.216.90 0 set AES + SHA 0 0
    3002 Serial0/1/0: 167.134.216.90 0 set AES + SHA 61 0

    ER-7600 #sh active cryptographic engine connections

    Algorithm of address State IP Interface ID encrypt decrypt
    3 Serial1/0/0:1 167.134.216.89 set HMAC_SHA + AES_CBC 0 0
    2000 Serial1/0/0:1 167.134.216.89 set HMAC_SHA + 0 66 AES_CBC
    2001 Serial1/0/0:1 167.134.216.89 set HMAC_SHA + AES_CBC 0 0

    I had this error on the er-3845: % CRYPTO-4-RECVD_PKT_NOT_IPSEC: Rec'd package not an IPSEC packet and this one on the IPSEC (epa_des_crypt) UH-7600: decrypted packet has no control of his identity

    Please help, it's so frustrating...

    Thanks in advance

    Oscar

    Here is a document from cisco, mentioning clearly for a card encryption on the two physical as tunnel interface well.

    http://www.Cisco.com/en/us/Tech/tk583/TK372/technologies_configuration_example09186a008009438e.shtml

    It may be useful

    Manish

  • VPN between 2 1841 router using a connection HDSL

    Hi all

    I need help to solve my problem, sorry for my English, I'll try to explain my problem

    I need to build a VPN (ipsec) between 2 side that use a Cisco 1841 router, each with its own public IP address.

    The side 2 can ping each public IP address but the VPN are DOWN state.

    The schema is the following:

    192.168.1.0/24 (LAN1) <->Ro1 (X.X.X.X) <- vpn="" -="">(Y.Y.Y.Y) Ro2 <->192.168.2.0/24 (LAN2)

    the configuration of the Ro1 is shown on, the same configuration is present also in Ro2, but with a different IP address

    SH run
    Building configuration...

    Current configuration: 9808 bytes
    !
    version 12.4
    horodateurs service debug datetime msec
    Log service timestamps datetime msec
    encryption password service
    !
    hostname TEST
    !
    boot-start-marker
    start the flash c1841-adventerprisek9 - mz.124 - 24.T.bin system
    boot-end-marker
    !
    forest-meter operation of syslog messages
    logging buffered 51200 warnings
    !
    No aaa new-model
    dot11 syslog
    no ip source route
    !
    !
    !
    !
    IP cef
    no ip bootp Server
    IP domain name test.it
    Server name x.x.x.x IP
    Server name x.x.x.x IP
    inspect the IP log drop-pkt
    inspect the IP incomplete-max 300 low
    inspect the high IP-400 max-incomplete
    IP inspect a minute low 300
    IP inspect hashtable-size 2048
    inspect the IP tcp synwait-time 20
    inspect the tcp host incomplete-max 300 IP block-time 60
    inspect the name ID tcp IP
    inspect the IP udp ID name
    inspect the IP ftp login name
    No ipv6 cef
    !
    Authenticated MultiLink bundle-name Panel
    !
    !
    !
    !
    !
    Password username privilege 15 TEST TEST 0
    Archives
    The config log
    hidekeys
    !
    !
    crypto ISAKMP policy 10
    BA 3des
    md5 hash
    preshared authentication
    Group 2
    !
    address TEST key crypto isakmp Y.Y.Y.Y
    ISAKMP crypto keepalive 10
    !
    !
    Crypto ipsec transform-set VPN - SET esp-3des esp-md5-hmac
    !
    VPN ipsec-isakmp crypto map
    defined peer Y.Y.Y.Y
    transformation-VPN-SET game
    match address 150
    !
    !
    !
    property intellectual ssh time 60
    property intellectual ssh authentication-2 retries
    property intellectual ssh version 2
    !
    !
    !
    interface FastEthernet0/0
    Description * Ro1-> LAN router *.
    IP 192.168.1.254 255.255.255.0
    IP nat inside
    IP virtual-reassembly
    automatic duplex
    automatic speed
    No keepalive
    !
    !
    interface Serial0/0/0
    no ip address
    frame relay IETF encapsulation
    event logging subif-link-status
    dlci-change of status event logging
    IP access-group 103 to
    load-interval 30
    no fair queue
    frame-relay lmi-type ansi
    !
    point-to-point interface Serial0/0/0.1
    Description * Ro1-> WAN router *.
    IP x.x.x.x 255.255.255.252
    NAT outside IP
    inspect the IP ID out
    IP virtual-reassembly
    SNMP trap-the link status
    No cdp enable
    No arp frame relay
    frame-relay interface dlci 100 IETF
    VPN crypto card
    !
    !
    IP forward-Protocol ND
    IP route 0.0.0.0 0.0.0.0 Serial0/0/0.1

    no ip address of the http server
    no ip http secure server
    !
    !
    IP nat inside source map route VPN - NAT interface overloading Serial0/0/0.1
    !
    !

    Access-list 100 * ACL NAT note *.
    access-list 100 deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
    access-list 100 permit ip 192.168.1.0 0.0.0.255 any
    Note access-list 103 *.
    Note access-list 103 * OPEN PORTS VPN *.
    access-list 103 allow udp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 eq non500-isakmp
    access-list 103 allow udp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 eq isakmp
    access-list 103 allow esp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
    access-list 103 allow ahp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
    access-list 103 deny ip any one
    Note access-list 150 * ACL VPN *.
    access-list 150 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255

    Note access-list 150 *.
    !
    route VPN - NAT allowed 10 map
    corresponds to the IP 100
    !
    control plan
    !
    !
    !
    Line con 0
    local connection
    line to 0
    line vty 0 4
    privilege level 15
    local connection
    transport input telnet ssh
    line vty 5 15
    privilege level 15
    local connection
    transport input telnet ssh
    !
    Scheduler allocate 20000 1000
    end

    Thus, according to the display of the response of these controls.

    Ro1 (config) # sh encryption session
    Current state of the session crypto

    Interface: Serial0/0/0.1
    The session state: down
    Peer: 81.21.17.146 port 500
    FLOW IPSEC: allowed ip 192.168.1.0/255.255.255.0 192.168.2.0/255.255.255.0
    Active sAs: 0, origin: card crypto

    Ro1 (config) # sh crypto map interface serial 0/0/0.1
    "VPN" 1-isakmp ipsec crypto map
    By peer = Y.Y.Y.Y
    Extend 150 IP access list
    access-list 150 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
    Current counterpart: Y.Y.Y.Y
    Life safety association: 4608000 kilobytes / 86400 seconds
    Answering machine-only (Y/N): N
    PFS (Y/N): N
    Transform sets = {}
    VPN - SET: {esp-3des esp-sha-hmac},.
    }
    Interfaces using crypto card VPN:
    Serial0/0/0.1

    Thanks in advance

    No, you don't have source your ping to the LAN interface.

    In Ro1: Source of ping 192.168.2.254 192.168.1.3

    OR / of Ro2: source ping 192.168.1.3 192.168.2.254

  • HDR Photoshop script

    Hi, I would need your help. I want to customize this code it will automatically run when I launch immediately click OK plus. Thank you very much.

    #target photoshop
    
    /*********************************************************************
     Batch HDR Script by David Milligan
    *********************************************************************/
    
    /*********************************************************************
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    **********************************************************************/
    
    /*
    // BEGIN__HARVEST_EXCEPTION_ZSTRING
    
    <javascriptresource>
    <name>Batch HDR...</name>
    <menu>automate</menu>
    </javascriptresource>
    
    // END__HARVEST_EXCEPTION_ZSTRING
    */
    
    //these lines import the 'Merge To HDR.jsx' script that is built in to photoshop, we will make calls to that script and some of the scripts that it includes
    var runMergeToHDRFromScript = true;
    var g_ScriptFolderPath = app.path + "/"+ localize("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts");
    var g_ScriptPath = File( g_ScriptFolderPath+'/Merge To HDR.jsx' );
    $.evalFile( g_ScriptPath ); 
    //$.level = 2;
    
    //default settings:
    mergeToHDR.useAlignment = true;
    mergeToHDR.useACRToning = false;
    var numberOfBrackets = 3;
    var userCanceled = false;
    var sourceFolder = new Folder('/d/Automata/LOADING');;
    var outputFolder = new Folder('/d/Automata/LOADING');;
    var saveType = "JPEG";
    var jpegQuality = 80;
    var progress;
    var statusText;
    var progressWindow;
    var fileMask = "*";
    var outputFilename = "hdr_output_";
    var zeroPadding = 2;
    
    var hdrRadius = 100;
    var hdrStrength = 0.5;
    var hdrGamma = 1.0;
    var hdrExposure = 0.0;
    var hdrDetail = 100;
    var hdrShadow = 0;
    var hdrHighlights = 0;
    var hdrVibrance = 20;
    var hdrSaturation = 30;
    var hdrSmooth = false;
    var hdrDeghosting = kMergeToHDRDeghostBest;//kMergeToHDRDeghostOff
    var hdrCurve = "0,0,255,255";
    var estTimeRemaining = "";
    
    var previewDoc;
    var originalDoc;
    
    function main()
    {
        promptUser();
        
        //make sure user didn't cancel
        if(sourceFolder != null && outputFolder != null && sourceFolder.exists && outputFolder.exists && numberOfBrackets > 0)
        {
            initializeProgress();
            var files =  sourceFolder.getFiles(fileMask);
            files.sort();
            var currentFileList = new Array();
    
            var numberOfFiles = files.length;
            
            if (numberOfFiles % 3 == 0)
            {
                numberOfBrackets = 3;
            }
            else
            {
                numberOfBrackets = 2;
            }
    
            /* convert numberOfFiles to a string to make sure zeropaddingis high enough to cover all files */
            
            var numberOfFilesStr = "" + (numberOfFiles / numberOfBrackets);
            if (zeroPadding > 0 && zeroPadding < numberOfFilesStr.length)
            {
                zeroPadding = numberOfFilesStr.length;
            }
    
            for(var index = 0;  index < numberOfFiles; index++)
            {
                if((index % numberOfBrackets) == numberOfBrackets - 1)
                {
                    var start = new Date();
                    progress.value = 100 * index / numberOfFiles;
                    currentFileList.push(files[index]);
                    if(userCanceled) break;
                    if(numberOfBrackets > 1)
                    {
                        statusText.text = "Merging files "+(index-numberOfBrackets+2)+" - "+(index+1)+" of "+numberOfFiles + estTimeRemaining;
                        //for braketed exposures use the mergeToHDR script to merge the files into a single 32 bit image
                        mergeToHDR.outputBitDepth= 32;
                        
                        mergeToHDR.mergeFilesToHDR( currentFileList, mergeToHDR.useAlignment, hdrDeghosting );
                        statusText.text = "Toning files "+(index-numberOfBrackets+2)+" - "+(index+1)+" of "+numberOfFiles+ estTimeRemaining;
                    }
                    else
                    {
                        statusText.text = "Loading file "+(index+1)+" of "+numberOfFiles+ estTimeRemaining;
                        //otherwise just open the file
                        doOpenFile(files[index]);
                        statusText.text = "Toning file "+(index+1)+" of "+numberOfFiles+ estTimeRemaining;
                    }
                    progress.value = 100 * (index + numberOfBrackets / 2 ) / numberOfFiles;
                    if(userCanceled) break;
                    try
                    {
                        if(app.activeDocument != null && outputBitDepth < 32)
                        {
                            //apply the actual tone mapping to the HDR image to get it back down to 8 bits
                            doHDRToning();
                        }
                    }
                    catch(error)
                    {
                        alert(error + "\nCheck number of files in source folder");
                        break;
                    }
                    
                    //save the result and close
                    //TODO: add leading zeros to index in filename
                    
                    if(numberOfBrackets > 1)
                    {
                        statusText.text = "Saving result "+(index-numberOfBrackets+2)+" - "+(index+1)+" of "+numberOfFiles+ estTimeRemaining;
                    }
                    else
                    {
                        statusText.text = "Saving result "+(index+1)+" of "+numberOfFiles+ estTimeRemaining;
                    }
                    if(userCanceled) break;
                    doSaveFile(outputFolder.absoluteURI + "/" + outputFilename + ZeroPad(Math.round((index + 1)/numberOfBrackets), zeroPadding) );
                    activeDocument.close(SaveOptions.DONOTSAVECHANGES);
                    
                    //reset our file list
                    currentFileList = new Array();
                    
                    //calculate time remaining
                    var end = new Date();
                    var timeElapsed = end.getTime() - start.getTime();
                    var mins = timeElapsed / 60000 * ((numberOfFiles - index - 1) / numberOfBrackets);
                    estTimeRemaining = " | Remaining: " + ZeroPad((mins / 60).toFixed(0),2) + ":" + ZeroPad((mins % 60).toFixed(0),2);
                }
                else
                {
                    currentFileList.push(files[index]);
                }
            }
            progressWindow.hide();
        }
    }
    
    function doOpenFile(filename)
    {
        
        const eventOpen = app.charIDToTypeID('Opn ');
        var desc = new ActionDescriptor();
        desc.putPath( typeNULL, new File( filename ) );
        desc.putBoolean( kpreferXMPFromACRStr, true ); //not sure what this does or if it is needed
        executeAction( eventOpen, desc, DialogModes.NO );
        //if we don't convert the image to 32bit the mergeToHDR script will not tone our image when we call it, it will simply downconvert it to 8 bit
        convertTo32Bit ();
    }
    
    function convertTo32Bit()
    {
        var idCnvM = charIDToTypeID( "CnvM" );
        var desc6 = new ActionDescriptor();
        var idDpth = charIDToTypeID( "Dpth" );
        desc6.putInteger( idDpth, 32 );
        var idMrge = charIDToTypeID( "Mrge" );
        desc6.putBoolean( idMrge, false );
        var idRstr = charIDToTypeID( "Rstr" );
        desc6.putBoolean( idRstr, false );
        executeAction( idCnvM, desc6, DialogModes.NO );
    }
    
    function doSaveFile(filename)
    {
        if(saveType == "JPEG")
        {
            var jpgSaveOptions = new JPEGSaveOptions();
            jpgSaveOptions.embedColorProfile = true;
            jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
            jpgSaveOptions.matte = MatteType.NONE;
            jpgSaveOptions.quality = jpegQuality;
            activeDocument.saveAs(new File(filename), jpgSaveOptions, true /*Save As Copy*/, Extension.LOWERCASE /*Append Extention*/);
        }
        else if(saveType == "TIFF")
        {
            var tifSaveOptions = new TiffSaveOptions();
            tifSaveOptions.embedColorProfile = true;
            activeDocument.saveAs(new File(filename), tifSaveOptions, true /*Save As Copy*/, Extension.LOWERCASE /*Append Extention*/);
        }
        else if(saveType == "TIFF LZW")
        {
            var tifSaveOptions = new TiffSaveOptions();
            tifSaveOptions.embedColorProfile = true;
            tifSaveOptions.imageCompression = TIFFEncoding.TIFFLZW;
            activeDocument.saveAs(new File(filename), tifSaveOptions, true /*Save As Copy*/, Extension.LOWERCASE /*Append Extention*/);
        }
        else if(saveType == "TIFF ZIP")
        {
            var tifSaveOptions = new TiffSaveOptions();
            tifSaveOptions.embedColorProfile = true;
            tifSaveOptions.imageCompression = TIFFEncoding.TIFFZIP;
            activeDocument.saveAs(new File(filename), tifSaveOptions, true /*Save As Copy*/, Extension.LOWERCASE /*Append Extention*/);
        }
        else
        {
            activeDocument.saveAs(new File(filename), undefined, true /*Save As Copy*/, Extension.LOWERCASE /*Append Extention*/);
        }
    }
    
    function doHDRToning()
    {
        //create the ActionDescriptor that describes the HDR toning settings to use
        var hdDesc = new ActionDescriptor;
        hdDesc.putInteger( stringIDToTypeID( 'version' ), 6 );//I'm not sure what this does
        hdDesc.putInteger(  kmethodStr, 3 );// the toning method to use, 3 = local adaptation
        hdDesc.putDouble( stringIDToTypeID( 'radius' ), hdrRadius );
        hdDesc.putDouble( stringIDToTypeID( 'threshold' ), hdrStrength );// strength
        hdDesc.putDouble( stringIDToTypeID( 'center' ), hdrGamma );// gamma
        hdDesc.putDouble( stringIDToTypeID( 'brightness' ), hdrExposure );// exposure
        hdDesc.putDouble( stringIDToTypeID( 'detail' ), hdrDetail );
        hdDesc.putDouble( stringIDToTypeID( 'shallow' ), hdrShadow );
        hdDesc.putDouble( stringIDToTypeID( 'highlights' ), hdrHighlights );
        hdDesc.putDouble( stringIDToTypeID( 'vibrance' ), hdrVibrance );
        hdDesc.putDouble( stringIDToTypeID( 'saturation' ), hdrSaturation);
        hdDesc.putBoolean( stringIDToTypeID( 'smooth' ), hdrSmooth );
        hdDesc.putBoolean( stringIDToTypeID( 'deghosting' ), hdrDeghosting );
        
        //create the tone curve
        var cDesc = new ActionDescriptor;
        cDesc.putString( stringIDToTypeID( 'name' ), 'Default');
        var cList = new ActionList;
        var points = hdrCurve.split(',');
        for(var i = 0; i < points.length; i++)
        {
            if(i % 2 == 1)
            {
                var pDesc = new ActionDescriptor;
                pDesc.putDouble( stringIDToTypeID( 'horizontal' ), points[i-1] );
                pDesc.putDouble( stringIDToTypeID( 'vertical' ), points[i] );
                pDesc.putBoolean( keyContinuity , false );// ?????
                cList.putObject( charIDToTypeID( 'Pnt ' ), pDesc );
            }
        }
        cDesc.putList( stringIDToTypeID( 'curve' ), cList );
        hdDesc.putObject( kclassContour, classShapingCurve, cDesc );
        
        //call the script that actually invokes the toning plugin
        convertFromHDRNoDialog( outputBitDepth, hdDesc );
    }
    
    function initializeProgress()
    {
        progressWindow = new Window("palette { text:'Meilleure Visite Chargement', \
            statusText: StaticText { text: 'Processing Images...', preferredSize: [350,20] }, \
            progressGroup: Group { \
                progress: Progressbar { minvalue: 0, maxvalue: 100, value: 0, preferredSize: [300,20] }, \
                cancelButton: Button { text: 'Cancel' } \
            } \
        }");
        statusText = progressWindow.statusText;
        progress = progressWindow.progressGroup.progress;
        progressWindow.progressGroup.cancelButton.onClick = function() { userCanceled = true; }
        progressWindow.show();
    }
    
    function promptUser()
    {
        var setupWindow = new Window("dialog { orientation: 'row', text: 'Meilleure Visite', alignChildren:'top', \
            leftGroup: Group { orientation: 'column', alignChildren:'fill', \
                inputPanel: Panel { text: 'Input', \
                    sourceGroup: Group { \
                    }, \
                    bracketGroup: Group{ \
                        bracketLabel: StaticText { text: 'Number of Brackets: ' }, \
                        bracketBox: EditText { characters: 2 }, \
                        filterLabel: StaticText { text: 'File Filter: ' }, \
                        filterText: EditText { characters: 5 }, \
                        alignCheckBox: Checkbox { text: 'Align' }\
                        deghostLabel: StaticText { text: 'Deghost: ' }\
                        deghostDropDown: DropDownList { }, \
                    } \
                }, \
                toningPanel: Panel { text: 'Toning', orientation:'row', alignChildren:'top' } ,\
                outputPanel: Panel { text: 'Output', \
                    outputGroup: Group { \
                        outputBox: EditText { characters: 10, text: '', enabled:false }, \
                    }, \
                    outputOptionsGroup: Group { \
                        outputFilenameLabel: StaticText { text: 'Filename Format: ' }, \
                        outputFilenameText: EditText { characters: 10 }, \
                    }, \
                    saveSettingsGroup: Group { \
                        saveTypeLabel: StaticText { text: 'Save As: ' }, \
                        saveDropDown: DropDownList { }, \
                        jpegQualityLabel: StaticText { text: 'JPEG Quality (1-10): ' }, \
                        jpegQualityText: EditText { characters: 2}, \
                        outputBitDepthLabel: StaticText { text: 'Bit Depth', enabled:false }, \
                        outputBitDepthDropDown: DropDownList { enabled:false }, \
                    } \
                } \
            }, \
            rightGroup: Group { orientation: 'column', alignChildren:'fill', \
                okButton: Button { text: 'OK', enabled: true } \
                cancelButton: Button { text: 'Cancel' } \
            } \
        } ");
        
        generateToningPanel(setupWindow.leftGroup.toningPanel);
        
        //shortcut variables
        var sourceBox = setupWindow.leftGroup.inputPanel.sourceGroup.sourceBox;
        var sourceBrowse = setupWindow.leftGroup.inputPanel.sourceGroup.sourceBrowse;
        var bracketBox = setupWindow.leftGroup.inputPanel.bracketGroup.bracketBox;
        var filterText = setupWindow.leftGroup.inputPanel.bracketGroup.filterText;
        var alignCheckBox = setupWindow.leftGroup.inputPanel.bracketGroup.alignCheckBox;
        var outputBox = setupWindow.leftGroup.outputPanel.outputGroup.outputBox;
        var outputFilenameText = setupWindow.leftGroup.outputPanel.outputOptionsGroup.outputFilenameText;
        var outputFilenamePost = setupWindow.leftGroup.outputPanel.outputOptionsGroup.outputFilenamePost;
        var saveDropDown = setupWindow.leftGroup.outputPanel.saveSettingsGroup.saveDropDown;
        var jpegQualityText = setupWindow.leftGroup.outputPanel.saveSettingsGroup.jpegQualityText;
        var jpegQualityLabel = setupWindow.leftGroup.outputPanel.saveSettingsGroup.jpegQualityLabel;
        var outputBitDepthDropDown = setupWindow.leftGroup.outputPanel.saveSettingsGroup.outputBitDepthDropDown;
        var outputBitDepthLabel = setupWindow.leftGroup.outputPanel.saveSettingsGroup.outputBitDepthLabel;
        var okButton = setupWindow.rightGroup.okButton;
        var cancelButton = setupWindow.rightGroup.cancelButton;
        var toningPanel = setupWindow.leftGroup.toningPanel;
        var deghostDropDown = setupWindow.leftGroup.inputPanel.bracketGroup.deghostDropDown;
        
        //set default values
        bracketBox.text = numberOfBrackets;
        filterText.text = fileMask;
        //mergeToHDR.useAlignment = true;
        alignCheckBox.value = mergeToHDR.useAlignment;
        outputFilenameText.text = outputFilename;
        jpegQualityText.text = jpegQuality;
        saveDropDown.add("item", "TIFF");
        saveDropDown.add("item", "JPEG");
        saveDropDown.add("item", "TIFF LZW");
        saveDropDown.add("item", "TIFF ZIP");
        saveDropDown.selection = 0;
        outputBitDepthDropDown.add("item", "8");
        outputBitDepthDropDown.add("item", "16");
        outputBitDepthDropDown.add("item", "32");
        outputBitDepthDropDown.selection = 0;
        
        var generateDeghostDropDownList = function(count)
        {
            deghostDropDown.removeAll()
            deghostDropDown.add("item", "Best");
            deghostDropDown.add("item", "Off");
            for(var i = 0; i < count; i++)
            {
                deghostDropDown.add("item", i);
            }
            deghostDropDown.selection = 0;
        }
        generateDeghostDropDownList(numberOfBrackets);
        
        //event handlers
        bracketBox.onChange = function()
        { 
            numberOfBrackets = bracketBox.text;
            generateDeghostDropDownList(numberOfBrackets);
        };
        filterText.onChange = function() { fileMask = filterText.text; };
        alignCheckBox.onClick = function() { mergeToHDR.useAlignment = alignCheckBox.value; };
        deghostDropDown.onChange = function() 
        { 
            if(this.selection.text == "Best") 
                hdrDeghosting = kMergeToHDRDeghostBest;
            else if(this.selection.text == "Off")
                hdrDeghosting = kMergeToHDRDeghostOff;
            else
                hdrDeghosting = Number(this.selection.text);
                
        };
        outputBox.onChange = function()
        {
            outputFolder = new Folder(outputBox.text);
            okButton.enabled = sourceFolder != null && outputFolder != null && sourceFolder.exists && outputFolder.exists;
        };
        outputFilenameText.onChange = function() { outputFilename = outputFilenameText.text; };
    
        saveDropDown.onChange = function()
        {
            saveType = saveDropDown.selection.text;
            jpegQualityText.enabled = saveDropDown.selection.text == "JPEG";
            jpegQualityLabel.enabled = saveDropDown.selection.text == "JPEG";
            if(saveDropDown.selection.text == "JPEG")
            {
                outputBitDepthDropDown.selection = 0;
            }
            outputBitDepthDropDown.enabled = saveDropDown.selection.text != "JPEG" && saveDropDown.selection.text != "Radiance" && saveDropDown.selection.text != "OpenEXR";
            outputBitDepthLabel.enabled = outputBitDepthDropDown.enabled;
            
        };
        jpegQualityText.onChange = function() { jpegQuality = jpegQualityText.text; };
        outputBitDepthDropDown.onChange = function()
        { 
            outputBitDepth = outputBitDepthDropDown.selection.text; 
            toningPanel.enabled = outputBitDepth != 32;
        }
        okButton.onClick = function() { setupWindow.hide(); cleanUpPreviews(); };
        cancelButton.onClick = function() { sourceFolder = null, setupWindow.hide(); cleanUpPreviews(); };
        
        saveDropDown.onChange();
        outputBitDepthDropDown.onChange();
        
        setupWindow.show();
    }
    
    function cleanUpPreviews()
    {
        if(originalDoc != null)
        {
            originalDoc.close(SaveOptions.DONOTSAVECHANGES);
            originalDoc = null;
        }
        if(previewDoc != null)
        {
            previewDoc.close(SaveOptions.DONOTSAVECHANGES);
            previewDoc = null;
        }
    }
    
    function generateToningPanel(toningPanel)
    {
        var leftToningGroup = toningPanel.add("group{orientation:'column',alignChildren:'fill'}");
        var rightToningGroup = toningPanel.add("group{orientation:'column',alignChildren:'fill'}");
        var presetGroup = leftToningGroup.add("group{orientation:'row'}");
        var presetDropDown = presetGroup.add("dropdownlist");
        var loadPresetButton = presetGroup.add("button", undefined, "Load Preset");
        var edgePanel = leftToningGroup.add("panel",undefined,"Edge Glow");
        var radiusSlider = createSliderControl(edgePanel.add("group"), "  Radius: ", "px", 0, 500, 0, hdrRadius, function(newValue){ hdrRadius = newValue; });
        var strengthSlider = createSliderControl(edgePanel.add("group"), "Strength: ", "", 0, 4.0, 2, hdrStrength, function(newValue){ hdrStrength = newValue; });
        var edgeGroup = edgePanel.add("group");
        var smoothEdgesBox = edgeGroup.add("checkbox",undefined, "Smooth Edges");
        var detailPanel = leftToningGroup.add("panel",undefined,"Tone and Detail");
        var gammaSlider = createSliderControl(detailPanel.add("group"), "  Gamma: ", "", 0.1, 2.0, 2, hdrGamma, function(newValue){ hdrGamma = newValue; });
        var exposureSlider = createSliderControl(detailPanel.add("group"), "Exposure: ", "", -5.0, 5.0, 2, hdrExposure, function(newValue){ hdrExposure = newValue; });
        var detailSlider = createSliderControl(detailPanel.add("group"), "     Detail: ", "%", -300, 300, 0, hdrDetail, function(newValue){ hdrDetail = newValue; });
        var advancedPanel = leftToningGroup.add("panel",undefined,"Advanced");
        var shadowSlider = createSliderControl(advancedPanel.add("group"), "  Shadow: ", "%", -100, 100, 0, hdrShadow, function(newValue){ hdrShadow = newValue; });
        var highlightSlider = createSliderControl(advancedPanel.add("group"), " Highlight: ", "%",  -100, 100, 0, hdrHighlights, function(newValue){ hdrHighlights = newValue; });
        var vibranceSlider = createSliderControl(advancedPanel.add("group"), "  Vibrance: ", "%",  -100, 100, 0, hdrVibrance, function(newValue){ hdrVibrance = newValue; });
        var saturationSlider = createSliderControl(advancedPanel.add("group"), "Saturation: ", "%",  -100, 100, 0, hdrSaturation, function(newValue){ hdrSaturation = newValue; });
        var toningCurvePanel = leftToningGroup.add("panel{text:'Toning Curve',alignChildren:'fill'}");
        var curveBox = toningCurvePanel.add("edittext", undefined, hdrCurve);
        
        //default values
        smoothEdgesBox.value = hdrSmooth;
        var presetFiles = getPresetFiles();
        var updateSliders = function()
        {
            radiusSlider(hdrRadius);
            strengthSlider(hdrStrength);
            smoothEdgesBox.value = hdrSmooth;
            exposureSlider(hdrExposure);
            gammaSlider(hdrGamma);
            detailSlider(hdrDetail);
            shadowSlider(hdrShadow);
            highlightSlider(hdrHighlights);
            vibranceSlider(hdrVibrance);
            saturationSlider(hdrSaturation);
            curveBox.text = hdrCurve;
        }
        if(presetFiles.length > 0)
        {
            for(var f in presetFiles)
            {
                presetDropDown.add("item", presetFiles[f].displayName.replace(".hdt",""));
            }
            presetDropDown.selection = 0;
            loadPreset(presetFiles[0]);
            presetDropDown.onChange = function()
            {
                loadPreset(presetFiles[presetDropDown.selection.index]);
                updateSliders();
            };
        }
        
        //event handlers
        loadPresetButton.onClick = function()
        {
            loadPreset(null);
            updateSliders();
        };
        smoothEdgesBox.onClick = function () { hdrSmooth = smoothEdgesBox.value; };
        curveBox.onChange = function () { hdrCurve = curveBox.text; };
        
        updateSliders();
    }
    
    
    function createSliderControl(group,label,postLabel,min,max,round,value,onValueChanged)
    {
        var ignoreChange = false;
        group.add("statictext", undefined, label);
        var slider = group.add("slider",undefined,value,min,max);
        slider.alignment = "fill";
        var box = group.add("edittext",undefined,value);
        box.characters = 6;
        group.add("statictext", undefined, postLabel);
        slider.onChange = function()
        {
            if(!ignoreChange)
            {
                ignoreChange = true;
                box.text = slider.value.toFixed(round);
                onValueChanged(slider.value);
                ignoreChange = false;
            }
        };
        box.onChange = function()
        {
            if(!ignoreChange)
            {
                ignoreChange = true;
                slider.value = box.text;
                onValueChanged(box.text);
                ignoreChange = false;
            }
        };
        return function(newValue)
        {
            slider.value = newValue;
            box.text = newValue.toFixed(round);
        };
    }
    
    //forces a redraw while a script dialog is active (for preview)
    var waitForRedraw = function()
    {
        var desc = new ActionDescriptor();
        desc.putEnumerated(charIDToTypeID("Stte"), charIDToTypeID("Stte"), charIDToTypeID("RdCm"));
        executeAction(charIDToTypeID("Wait"), desc, DialogModes.NO);
    }
    
    function getZoomLevel()
    {
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
        var desc = executeActionGet(ref);
        return Number(desc.getDouble(stringIDToTypeID('zoom'))*100).toFixed(1);
    }
    
    function setZoomLevel( zoom )
    {
        if(zoom < 1 ) zoom =1;
        var ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
        var getScrRes = executeActionGet(ref).getObjectValue(stringIDToTypeID('unitsPrefs')).getUnitDoubleValue(stringIDToTypeID('newDocPresetScreenResolution'))/72;
        var docRes = activeDocument.resolution;
        activeDocument.resizeImage( undefined, undefined, getScrRes/(zoom/100), ResampleMethod.NONE );
        var desc = new ActionDescriptor();
        ref = null;
        ref = new ActionReference();
        ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), charIDToTypeID( 'PrnS' ) );
        desc.putReference( charIDToTypeID( "null" ), ref );
        executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
        activeDocument.resizeImage( undefined, undefined, docRes, ResampleMethod.NONE );
    }
    
    function ZeroPad(number,numZeros)
    {
        var result = number.toString();
        while(result.length < numZeros)
        {
            result = "0" + result;
        }
        return result;
    }
    
    var getPresetFiles = function()
    {
        var presetFolder = new Folder(app.path + "/Presets/HDR Toning");
        return presetFolder.getFiles("*.hdt");
    }
    
    var loadPreset = function(presetFile)
    {
        if(presetFile == null)
        {
            presetFile = File.openDialog("Select Preset","*.hdt");
        }
        if(presetFile != null)
        {
            var tmpStr = new String();
            var binaryData = new Array();
            presetFile.encoding = "BINARY";
            presetFile.open('r');
            while(!presetFile.eof)
            {
                var ch = presetFile.readch();
                if ( ch.charCodeAt(0) == 0 ){
                    tmpStr += ' ';
                }
                else {
                    tmpStr += ch;
                }
                binaryData.push(ch.charCodeAt(0));
            }
            presetFile.close();
            if(binaryData.length >= 40)
            {
                // init start position for reading datas
                // start position for english version ( string "D e f a u l t" is in the preset file )
                var startPos = 38;
                if ( tmpStr.search ("P a r   d é f a u t") > -1 ){
                    // start position for french preset file version ( string "P a r   d é f a u t" is in the preset file ) (==> + 6 bytes)
                    startPos = 44;
                }
                // if your preset file can't be read, try this : open it in notepad to see the string "D e f a u l t" in your language and add the code here to set startPos to 38 + diff between the length of ("D e f a u l t") and length of ("D e f a u l t" in your language)
                var curvePointCount = getUInt16(binaryData, startPos);
                if(binaryData.length >= 104 + curvePointCount * 4)
                {
                    var curvePointStr = "";
                    for(var i = 0; i < curvePointCount; i++)
                    {
                        curvePointStr += getUInt16(binaryData, startPos + 4 + i * 4) + "," + getUInt16(binaryData, startPos + 2 + i * 4) + ((i < curvePointCount - 1) ? "," : "");
                    }
                    hdrCurve = curvePointStr;
                    
                    hdrStrength =  getFloat32(binaryData,8);
                    hdrRadius = getFloat32(binaryData, startPos + 10 + 5 * curvePointCount);
                    hdrExposure = getFloat32(binaryData, startPos + 34 + 5 * curvePointCount);
                    hdrSaturation = getFloat32(binaryData, startPos + 38 + 5 * curvePointCount);
                    hdrDetail = getFloat32(binaryData, startPos + 42 + 5 * curvePointCount);
                    hdrShadow = getFloat32(binaryData, startPos + 46 + 5 * curvePointCount);
                    hdrHighlights = getFloat32(binaryData, startPos + 50 + 5 * curvePointCount);
                    hdrGamma = getFloat32(binaryData, startPos + 54 + 5 * curvePointCount);
                    hdrVibrance = getFloat32(binaryData, startPos + 58 + 5 * curvePointCount);
                    hdrSmooth = getUInt16(binaryData, startPos + 62 + 5 * curvePointCount) != 0;
                }
                else
                {
                    alert("Error Loading File", "Error", true);
                }
            }
            else
            {
                alert("Error Loading File", "Error", true);
            }
        }
    }
    
    function getUInt16(byteArray,offset)
    {
        return byteArray[offset] * 0x100 + byteArray[offset + 1];
    }
    
    function getUInt32(byteArray,offset)
    {
        return byteArray[offset] * 0x1000000 + byteArray[offset + 1] * 0x10000 + byteArray[offset + 2] * 0x100 + byteArray[offset + 3];
    }
    
    function getFloat32(byteArray,offset)
    {
        var bytes = getUInt32(byteArray,offset);
        var sign = (bytes & 0x80000000) ? -1 : 1;
        var exponent = ((bytes >> 23) & 0xFF) - 127;
        var significand = (bytes & ~(-1 << 23));
        
        if (exponent == 128)
            return sign * ((significand) ? Number.NaN : Number.POSITIVE_INFINITY);
        
        if (exponent == -127) {
            if (significand == 0) return sign * 0.0;
            exponent = -126;
            significand /= (1 << 22);
        } else significand = (significand | (1 << 23)) / (1 << 23);
        
        return sign * significand * Math.pow(2, exponent);
    }
    
    main();
    
    

    I do not support exhibitions in order to perform processing HDR.   I don't want to create HDR images. The EXIF data does not have an EV adjustment. You can calculate EV information EXIF information.  Should the process of HDR data EXIF to calculate EV your image file need to have then the metadata.  Your script can be able to be something for the HDR script, I have no idea what the deghostFlag is all. Maybe if you examine the code in the script of David Milligan you can very well how to use the HDR script from another script.

  • The query result

    create table course_tab (course_id number (6), course_amount number (6))

    insert into course_tab values (101,301)

    insert into course_tab values (102,95)

    insert into course_tab values (201,250)

    insert into course_tab values (202,120)

    insert into course_tab values (301,405)

    insert into course_tab values (302,440)

    insert into course_tab values (303,85)

    I need the output below:

    amount_range avaliable_courses

    ___________     _______________

    1-100                    2

    1 101 - 200

    1 201 - 300

    1 301 - 400

    2 401 - 500

    Thank you for helping to advance

    SQL> with ranges as (
      2  select 1 min, 100 max from dual union all
      3  select 101 min, 200 max from dual union all
      4  select 201 min, 300 max from dual union all
      5  select 301 min, 400 max from dual union all
      6  select 401 min, 500 max from dual
      7  )
      8  select ranges.min||'-'||ranges.max amount_range
      9  ,      count(course_amount)        available_courses
     10  from   ranges
     11  ,      course_tab
     12  where  course_amount between ranges.min and ranges.max
     13  group by ranges.min||'-'||ranges.max
     14  order by ranges.min||'-'||ranges.max;
    AMOUNT_RANGE                                                                     |AVAILABLE_COURSES
    ---------------------------------------------------------------------------------|-----------------
    1-100                                                                            |                2
    101-200                                                                          |                1
    201-300                                                                          |                1
    301-400                                                                          |                1
    401-500                                                                          |                2
    5 rows selected.
    

Maybe you are looking for