Breakup time range

Hello

I have following data in my table of LEAVE. I want to divide each period of leave at different times.

with

leave as)

Select 1 as empid, to_date (08 January 1 2014:00 ',' DD/MM/YYYY HH24 ') as leavefrom, to_date (March 1, 2014 16:00 ',' DD/MM/YYYY HH24 ') as leaveto of all the double union

Select 2 as empid, to_date (08 January 1 2014:00 ',' DD/MM/YYYY HH24 ') as leavefrom, to_date (1 January 2014 16:00 ',' DD/MM/YYYY HH24 ') as leaveto of union double all the

)

Power required is as follows

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

ID FROM_TIME TO_TIME

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

1 01/01/2014 08:00 01/02/2014 00:00

1 02/01/2014 00:00 01/03/2014 00:00

1 03/01/2014 00:00 01/03/2014 16:00

2 01/01/2014 08:00 01/01/2014 16:00

I use oracle 10 g

Help, please...

Hello

2730134 wrote:

Hi Frank,.

Power required is as follows...

Sorry, my mistake.  I forgot start_date truncated when added to it:

WITH got_ndays AS

(

SELECT empid, leavefrom, leaveto

, CEIL (leaveto - TRUNC (leavefrom)) AS ndays

Annual LEAVE

)

got_maxndays AS

(

SELECT MAX (ndays) AS maxndays

OF got_ndays

)

AS cntr

(

SELECT LEVEL AS n

OF got_maxndays

CONNECT BY LEVEL<=>

)

SELECT n.empid

Largest (n.leavefrom

TRUNC (n.leavefrom) + c.n - 1

) AS dayfrom

, The LEAST (n.leaveto

TRUNC (n.leavefrom) + c.n

) AS Degnide

OF got_ndays n

CNTR JOIN c ON c.n<=>

ORDER BY n.empid

,         c.n

;

Output:

EMPID DAYFROM DEGNIDE

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

1 01/01/2014 08:00 01/02/2014 00:00

1 02/01/2014 00:00 01/03/2014 00:00

1 03/01/2014 00:00 01/03/2014 16:00

2 01/01/2014 08:00 01/01/2014 16:00

Tags: Database

Similar Questions

  • Manipulation of time range

    Hello

    I have a custom dashboard where there is a TimeRange, I want to display the report on a date given (date) and exactly a month before (date). I created a script to calculate the value of date.

    package user._foglight.scripts;

    def startCal = Calendar.GetInstance)

    startCal.setTime (timeRangeInput.getStart ())

    startCal.add (Calendar.MONTH, - 1).

    def endCal = Calendar.GetInstance)

    endCal.setTime (timeRangeInput.getEnd ())

    endCal.add (Calendar.MONTH, - 1).

    timeRangeInput.getStart () .setMonth (startCal.get (Calendar.MONTH))

    timeRangeInput.getStart () .setYear (startCal.get (Calendar.YEAR) - 1900)

    timeRangeInput.getEnd () .setMonth (endCal.get (Calendar.MONTH))

    timeRangeInput.getEnd () .setYear (endCal.get (Calendar.YEAR) - 1900)

    return timeRangeInput

    The problem is, when in the dashboard whenever I change the TimeRange, dateB is not changed, still using the old value. Help, please.

    Ok. Solved my problem using this thread as a reference http://en.community.dell.com/techcenter/performance-monitoring/foglight-administrators/f/4788/t/19552460#47657

    So here is what I do

    I've created a script that will return the metadata 2:Custom slot

    Calendar calendar = Calendar.GetInstance ();

    def altTimeRange = timeRange.createTimeRange (calendar);

    Calendar startCalendar = Calendar.GetInstance ();

    startCalendar.setTime (altTimeRange.getStart ());

    startCalendar.add (Calendar.MONTH,-1);

    Calendar endCalendar = Calendar.GetInstance ();

    endCalendar.setTime (altTimeRange.getEnd ());

    endCalendar.add (Calendar.MONTH,-1);

    def range = endCalendar.getTime () .getTime () - startCalendar.getTime () .getTime ();

    def altTimeRange1 = functionHelper.invokeFunction ("system:wcf_common.9", range, startCalendar.getTime (), 0);

    Return altTimeRange1;

    These script, you can assign the value returned in commune: interval of time in the view

    But this is the trickiest part, if you assign the value to the primary inputs , the script will be called only once, so no matter how many times you have tried to change the time of the range custom time remains unchanged from the beach. I don't know if this is a bug or not.

    However, if you put the time range to additional entries these script will be called whenever the time slot changed

    Took me a while to understand this hope of output, it will help someone :)

     

  • BlackBerry Smartphones black box with timer ranging tour continues to appear!

    I get the black box with timer ranging tour continues to appear! I know how to use the clear application memory integrated into my BB, I also remember Boost, I know how to click the browser, and then click options tik down 2 boxes and everything else, I pulled the battery, I also Bejoose. It just started the last few days. Its really frustrating trying to type something in an email or FB and freeze for a minute or two. I don't know what I can do.

    Goto options

    Press the button to get the menu and activate keyboard BB

    Press on and hold & % 123 key for 3 sec

    type -. 5 * and Analyzer device is activated

    If you make it at all, press ESC to home screen and try again.

  • Bind the time range slider to input fields

    I went through a bunch of tutorials and can't seem to find the answer to this. I'm trying to implement a cursor of the chronological range for entry into a database. I started with the example

    http://codepen.io/caseymhunt/pen/kertA.

    I have two input fields IDs StartTimeEntry and EndTimeEntry . How can I get the values of the scabbard for updating the values of these two fields of entry form?

    Thank you.

    Locate the following line in the script jQuery on CodePen:

    $('.slider-time').html (hours1 + ':' + minutes1);

    Replace it with this:

    $('#startTimeEntry').val (hours1 + ';' + minutes1);

    Similarly, replace this:

    $('.slider-time2').html (hours2 + ':' + minutes2);

    with this:

    $('#endTimeEntry').val (hours2 + ':' + minutes2);

  • How can I delete the history for a specific time range?

    I would like to delete my browsing history that is older than three months. I was trying to just remove it from the history, but I can't do more than one site at a time. Is it possible to delete several sites at the same time or put in place to delete automatically any more than three months? I know I can clear recent history easily, but it isn't recent history I want to remove them easily.

    Hello emily, normally in the library you can press ctrl + a to select all the entries in a folder/category. This should make it easy to remove all entries from the history at the same time.

  • Impossible to select the time range in dropdown menu-foglight PASS UI.

    Hello

    I'm new to foglight and is having a little problem with the user interface. I doubt if I'm in the right place to ask this question.

    I use Foglight for SQL Server 7.0 v. Under UI, there is a drop down for the time interval, which, in my view, does not work as expected.

    Please see the snapshot. Here, when I click on "last hour", next to the slot, a drop down menu arrow rises but it disappears very quickly and I can't change. I think that this menu has options like "last 15 minutes, last 6 h etc.

    Please notify.

    Thank you

    I found the solution. It was because of two monitors.   Once I went to the main screen, I could see menu items drop down.

  • Time range of statistical performance data store

    When I look at the performance of the data store tab in the performance monitor what time slot is used to generate the statistics?

    Hi Michael,

    The time slot is for 24 hours.

  • The performance of the processor and memory performance by the Date and time range

    Hi Expert,

    I'm not that good in script and even learn how to write one, but for the moment that I need help get script that could generate as below output.

    Example query:

    Retrieve logs performance for vmname1, vmname2, vmname3 from 07:00 to 10:00 on 25/05/2012.

    CPU MHZ, and MEM in MB.

    VMNameDateTimeMemMaxMemAvgMemMinCPUMaxCPUAvgCPUMin
    vmname125/05/201206:0055,4948.3044,5518.3410.567.43
    vmname225/05/201207:0052,8247,8144,3528.149.804.23
    vmname325/05/201208:0048.6246.0442.1922.5112.928.80
    vmname425/05/201209:0049.1147.6641,4515.828 h 454.36

    I appreciate really all advice in this area. Thank you.

    You can try something like this

    $vms = Get-VM vmname1,vmname2,vmname3  $metrics = "cpu.usagemhz.average","mem.usage.average","cpu.usagemhz.minimum",          "mem.usage.minimum","cpu.usagemhz.maximum","mem.usage.maximum" $start = Get-Date -Hour 7 -Minute 0 -Second 0 -Day 25 -Month 5 -Year 2012$finish = Get-Date -Hour 10 -Minute 0 -Second 0 -Day 25 -Month 5 -Year 2012
    Get-Stat -Entity $vms -Stat $metrics -Start $start -Finish $finish |Group-Object -Property EntityId,Timestamp | %{
      New-Object PSObject -Property @{
        VMName = $_.Group[0].Entity.Name    Date = $_.Group[0].Timestamp.ToLongDateString()
        Time = $_.Group[0].Timestamp.ToLongTimeString()
        MemMax = $_.Group | where {$_.MetricId -eq "mem.usage.maximum"} | Select -ExpandProperty Value    MemAvg = $_.Group | where {$_.MetricId -eq "mem.usage.average"} | Select -ExpandProperty Value    MemMin = $_.Group | where {$_.MetricId -eq "mem.usage.minimum"} | Select -ExpandProperty Value    CpuMax = $_.Group | where {$_.MetricId -eq "cpu.usagemhz.maximum"} | Select -ExpandProperty Value    CpuMin = $_.Group | where {$_.MetricId -eq "cpu.usagemhz.minimum"} | Select -ExpandProperty Value    CpuAvg = $_.Group | where {$_.MetricId -eq "cpu.usagemhz.average"} | Select -ExpandProperty Value  }
    }
    

    Note that this will depend on the statistical level that you set for the chosen time interval, if the measures minimum and maximum will be available.

  • Script to find concurrent work that ran for a long time in the time range

    Oracle Apps:12.1.1
    DB: 11.1.0.7
    OS: Linux RedHat 86 x 64

    All,

    A particular day could someone please share the Script to find concurrent work who long ran specifically say between 15:00-16:00 in the one hour time slot.

    Thanks for your time!

    Kind regards

    A particular day could someone please share the Script to find concurrent work who long ran specifically say between 15:00-16:00 in the one hour time slot.

    https://forums.Oracle.com/forums/search.jspa?threadID=&q=actual_start_date+and+FND_CONCURRENT_REQUESTS&objid=C3&DateRange=all&userid=&NumResults=15&rankBy=10001
    https://forums.Oracle.com/forums/search.jspa?threadID=&q=actual_start_date+and+fnd_conc_req_summary_v&objid=C3&DateRange=all&userid=&NumResults=15&rankBy=10001

    Thank you
    Hussein

  • Create a custom event based on a time range

    I'm checking what past events have woken up my pc to sleep for the night. How can I set the custom display only all events between say 22.00 and 07.00 rather than having to go 24 hours every day. Furthermore, if this is not possible, can I just see beyond events that have become aware of my pc.

    Ron

    In paragraph 2.23 answered your initial question:
    http://www.gerryscomputertips.co.UK/syserrors6.htm

  • BlackBerry Smartphones calendar change time range

    My calendar shows a period of 9-5 daily... How can I change this as working hours are more than a simple 9-5...

    Thank you!

    GV

    Menu = the left key of the trackball... with the RIM logo on it... points.

  • Why Time Warner Cable webmail is now a non-secure site grey triangle? It was beautiful last night; just happened this morning. TWC has been of no help.

    Get the gray triangle on webmail.maine.rr.comwarning; other sites I use are safe. Is this a problem of Mozilla or TWC?

    Hello

    Maybe there was an update on the site? I just visited the link you mentioned an I see a lock symbol, letting me know my connection is secure. You can try this:

    Many issues of the site can be caused by corrupted cookies or cache. To try to solve these problems, the first step is to clear cookies and cache.
    Note: This will be you temporarily disconnect all sites, you're connected to.
    To clear the cache and cookies to do the following:

    1. Click the menu button

      , choose historic, then "Claire recent history...". ».

    2. Under "Time range to clear", select "all".
    3. Now, click the arrow next to details to toggle the active details list.
    4. In the list of details, see the Cache and Cookies and uncheck everything.
    5. Now click on the "Clear now" button

    More information can be found in the article remove the navigation, search and download history on Firefox .

    This solve your problems? Please report to us!

    Thank you.

  • History - history recent beach time is displayed

    Hi I have a problem with my recent history of compensation.
    The problem is my time range to clear is buged and not displayed.
    I tried reinstalling firefox and all the parameters of compensation, but it did not help.
    So I decided to write here for more help.
    Thank you

    It seems to be more wrong, looking at bugs that have been tabled:

    Only these two lines must be in the userChrome.css file:

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    #SanitizeDialog { width: 34em !important; }
    
  • EBay on Firefox screen is several hundred times too big, but not on Explorer. All the necessary patches?

    I logged on the ebay web site and home page displays correctly, but when I try to search the categories, the pages appear much too large. This does not happen on Internet Explorer. Are there patches that I need to download or update?

    Hello

    Many issues of the site can be caused by corrupted cookies or cache. To try to solve these problems, the first step is to clear cookies and cache.
    Note: This will be you temporarily disconnect all sites, you're connected to.
    To clear the cache and cookies to do the following:

    1. Go to Firefox > history > clear recent history or (if no Firefox button is displayed) go to tools > clear recent history.
    2. Under "Time range to clear", select "all".
    3. Now, click the arrow next to details to toggle the active details list.
    4. In the list of details, see the Cache and Cookies and uncheck everything.
    5. Now click the clear now button.

    More information can be found in article to clear your cache, history, and other personal information in Firefox .

    This solve your problems? Please report to us!

    Thank you.

  • Why using Mozilla to enter a web site is my password rejected when he worked for a long time. PASSWORD is corerect

    Years my password work when you use MOZILLA by accessing the web site XPRESSBET. Now
    my password is rejected, but it works with other browsers such as Google Chrome or Internet Explorer.

    Many issues of the site can be caused by corrupted cookies or cache. To try to solve these problems, the first step is to clear cookies and cache.
    Note: This will be you temporarily disconnect all sites, you're connected to.
    To clear the cache and cookies to do the following:

    1. Go to Firefox > history > clear recent history or (if no Firefox button is displayed) go to tools > clear recent history.
    2. Under "Time range to clear", select "all".
    3. Now, click the arrow next to details to toggle the active details list.
    4. In the list of details, see the Cache and Cookies and uncheck everything.
    5. Now click the clear now button.

    More information can be found in article to clear your cache, history, and other personal information in Firefox .

    This solve your problems? Please report to us!

Maybe you are looking for