GO TO DIFFERENT DATES

Hello

I have the rest of the table.

CREATE TABLE PERMITTEDMINUTES AS

(

SELECT 1 EMPID, TO_DATE (' 21/03/2015 ',' DD/MM/YYYY') FROMDATE, TO_DATE('25/03/2015','DD/MM/YYYY') TO DATE, 30 MINS FROM DUAL UNION ALL

SELECT 2 EMPID, TO_DATE (' 03/23/2015 ',' DD/MM/YYYY') FROMDATE, TO_DATE('26/03/2015','DD/MM/YYYY') TO DATE, 45 LIKE MINUTES FROM DUAL UNION ALL

SELECT 1 EMPID, TO_DATE (' 15/04/2015 ',' DD/MM/YYYY') FROMDATE, TO_DATE('20/04/2015','DD/MM/YYYY') TO DATE, 15 MINS FROM DUAL LIKE

);

This means from 21/03/2015 until 25/03/2015, the employee is allowed to take 30 minutes door without loss of pay.

also from 15/04/2015 until 20/04/2015, he is allowed to take 15-minute door daily.

I want that these lines must be extracted as follows

====================================================

EMPID DATE ALLOWED MINUTES

====================================================

21/03/2015 1, 30

22/03/2015 1, 30

1 30 23/03/2015

24/03/2015 1, 30

25/03/2015 1, 30

23/03/2015 2, 45

24/03/2015 2, 45

25/03/2015 2, 45

2 26/03/2015 45

15/04/2015 1, 15

16/04/2015 1, 15

17/04/2015 1, 15

18/04/2015 1, 15

19/04/2015 1, 15

20/04/2015 1, 15

===================================================

I tried after query, but the output is not correct

SELECT

EmpID,

FROMDATE + (LEVEL 1) PRDATE.

mins

PERMITTEDMINUTES log LEVEL < = TODATE - FROMDATE + 1;

Help, please

I use oracle 10 g

When you make a connection in query on several lines in the source, you must do a little trick with "prior sys_guid()" and other details of connection to allow it to connect simply on the details on the right while the generation of the line, but also to prevent a cycle in the data (you can simply use nocycle).

Like this...

SQL > ed
A written file afiedt.buf

1 with PERMITTEDMINUTES like)
2. SELECT 1 EMPID, TO_DATE (' 21/03/2015 ',' DD/MM/YYYY') FROMDATE, TO_DATE('25/03/2015','DD/MM/YYYY') TO DATE, 30 MINS FROM DUAL UNION ALL
3. SELECT 2 EMPID, TO_DATE (' 03/23/2015 ',' DD/MM/YYYY') FROMDATE, TO_DATE('26/03/2015','DD/MM/YYYY') TO DATE, 45 LIKE MINUTES FROM DUAL UNION ALL
4. SELECT 1 EMPID, TO_DATE (' 15/04/2015 ',' DD/MM/YYYY') FROMDATE, TO_DATE('20/04/2015','DD/MM/YYYY') TO DATE, 15 MINS FROM DUAL LIKE
5    )
6  --
7. end of test data
8  --
9. Select empid
10, fromdate + (level-1) as dt
11 mins as allowed_minutes
permittedminutes 12 p
13 connect by level<= (todate-fromdate)+1 ="" --="" row="">
14 and empid = empid prior - part of key for the specific source line
15 and fromdate = prior fromdate - part of key for the specific source line
16 and todate = prior to date - part of key for the specific source line
sys_guid() 17 and prior is not null - prevent the cycle of data
18 * order of p.fromdate, 2
SQL > /.

EMPID DT ALLOWED_MINUTES
---------- ------------------- ---------------
1 2015-21/03 00:00:00 30
1 22/03/2015-00:00:00 30
1 23/03/2015-00:00:00 30
1 24/03/2015-00:00:00 30
1 00:00:00 25/03/2015 30
2 23/03/2015-00:00:00 45
2 24/03/2015-00:00:00 45
2 00:00:00 25/03/2015 45
2 00:00:00 26/03/2015 45
1 2015/04/15 00:00:00 15
1 16/04/2015 00:00:00 15
1 17/04/2015 00:00:00 15
1 18/04/2015 00:00:00 15
1 19/04/2015 00:00:00 15
1 20/04/2015 00:00:00 15

15 selected lines.

Tags: Database

Similar Questions

  • iCloud full - found two backups with different dates

    My 20g iCloud storage is full.  When I went to manage my data, there were 2 backups of my iPhone with different dates.  Can I remove 1 of them (the older one I guess) without affecting my current phone?  I guess that's when I upgraded my iPhone 4 to 5

    Of,.

    Yes, as long as you can identify with certainty the backup latest.

  • How to convert an array of string elements to a cluster with elements named different data types?

    I'm looking for more help with the conversion of an array of elements of the chain in a cluster containing elements named different data types.

    I am importing data from an Excel worksheet.  He is coming in LabVIEW as separate (channels) 3 tables: 1) Variable name, (2) three possibilities Int, double, String) data type and the value 3), with the clues in each table corresponding to a separate variable (I have about 180 variables to import).  My ultimate goal is to convert the string array of 'Value' in a cluster.  But I want the correct data type in the cluster and I also the elements of the cluster name to match with the string 'Variable name' table so that I can use the Unbundle based on the name in my main VI.

    Please see attachment a Subvi for more details.  I did the size of the new items of tables 5 for simplicity.   I realize that labels property cannot be changed during execution and I don't think I need to do.  I just want to use the production cluster (mainly the unbundle by name) to help design my main VI.  I will need to 'read' and 'write for' the cluster during execution, but I won't need to change the names of the items.

    I was also wondering if there is a better way to import data from Excel?  Is it possible to import directly into a cluster immediately rather than put everything as strings?  I have attached a Subvi showing how I currently bring in data (found on the forum somewhere).  It comes as table 2D, which I divided into 3 separate tables that I mention above.

    I am open to any suggestion.  Thank you very much.

    -Mike

    Instead of trying to create a cluster, I think I would use only variant attributes.

  • In Windows Explorer. A dated file say 12/02/2000. When you click the folder, the files in the folder bear different date. Why is it so.

    ORIGINAL TITLE: I use Windows xp.

    I use Windows xp. In Windows Explorer. A dated file say 12/02/2000. When you click the folder, the files in the folder bear different date. Why is it so. To update the files, we should see the dates of the files instead of the dates of the folder. right? Why is there such a difference?

    My copy of Windows XP works the same as yours.  Apparently the date folder is not updated when the content is, that fact make some sense as the folder itself is not updated when new content is created in the it.

  • Tried to restore my computer to an earlier date & it keeps its back indicating it cannot restore to this date. I tried 6 different dates that are bold and assume to work. There is no info on what to do next

    Tried to restore my computer to an earlier date & it keeps its back indicating it cannot restore to this date.  I tried 6 different dates that are bold and assume to work. There is no info on what to do next

    Requel,.
    Thanks for posting on the Microsoft answers Forum.  The first thing I would suggest running a virus scan.  Make sure you have no virus causing problems.  If you do not have an antivirus program, then you can download it free here: http://www.microsoft.com/Security_essentials/

    If there is no virus or it still does not work after virus cleaning, then start in safe mode and test from there.  Here are the instructions for Safe Mode.

    Let us know the results. Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Dashboard calls between 2 different date columns

    Hi all

    I am creating a dashboard command prompt that will allow users to filter the report from 2 different date columns. We have an opening date column and a column of closing date. I want to allow users to choose an opening date and then a closing date that is at a later date. How could I go to set it up?

    Thank you in advance!

    I received your question, but I was not sure of your ability to create guest

    You will use 2 open and closed dates in the command prompt and set the variables in the presentation. In the report for this 1 date column use <= and="">= instead of operator.

  • How to set different date formats for different metadata fields?

    Hello

    Can I set different date for different fields of metadata formats? Standard Date format has a seconds. But I metadata fields, where I need to only show the date.

    I tried to use the rules and side effects. My code is: $xMyDate = formatDateOnly (xMyDate) $ >. But it does not work.

    Please how can I do?

    Thank you

    Martin

    Hi Laurent,.

    Large. This works. Good definition is:<$setValue("DOC_INFO","xDatumUkonceniRizeni",formatDateOnly(xDatumUkonceniRizeni))$>

    M.

  • To a different data store of VSs

    I need to create a job to move VMs from a different data store.

    I've created a script like the following:

    Add-PSSnapin VMware.VimAutomation.Core

    SE connect-VIServer x.y.z.t - username

    $target = "Datastore2".

    $listaVM =

    "VM1."

    "VM2."

    "VM3,

    "VM4."

    "VM5."

    "VM6".

    {foreach ($vm to $listaVM)

    $vm

    Get-VM-name $vm | Move-VM - Datastore $target - DiskStorageFormat 'thin '.

    }

    The work seems to work but I need to improve so that:

    • After launching the command VM1, it waits until the move is completed
    • If VM2 cannot be moved for some reason any the ongoing process in process VM3
    • After processing each VM I get information on the status of the move (success, error,...)

    Can someone please help?

    Concerning

    Marius

    Try something like this

    The RunAsync will start moving in the background, then the While loop waits until the move is completed.

    The Task object, the status of the move is obtained.

    Add-PSSnapin VMware.VimAutomation.Core

    SE connect-VIServer x.y.z.t - username

    $target = "Datastore2".

    $listaVM =

    "VM1."

    "VM2."

    "VM3,

    "VM4."

    "VM5."

    "VM6".

    foreach ($vm in Get-VM-name $listaVM) {}

    $job = move-VM - VM $vm - $target - DiskStorageFormat "Thin" - RunAsync Datastore

    While ($job. PercentComplete - do 100)

    {

    sleep 5

    $job = get-job | where {$_.} ID - eq $job. ID}

    }

    Write-Host "$($job.)". Result) is migrated, status $($job.) State).

    }

  • Migration of all the catalog items to a different data store in the same storage profiles

    Hello

    is any possibility to migrate everything in the catalog (time and iso files) to a different data store that has the same profile (Silver) storage group?  Because I have 2 groups of data store with the same profile of storage (Silver) and I want to delete one of this cluster.

    I found this kb: http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 2058094 but it speaks solely of media files of migration between different storage profiles.

    Have vCD 5.6.4

    You happen to use rapid Provisioning?  This is probably the only problem I can think of.

    Environments that have no linked Clones or shadows created from them, you can just Storage vMotion them between the same storage policy data warehouses.  Just make sure that the data store or a store of data clusters are visible in vCloud Director first of all in the framework of this storage policy.

    When you use linked clones, I don't remember the exact process... I think that I have in my office somewhere (I'm at home now).

  • How can I move a data store a single virtual disk shape in a different data store?

    I have a host running vSphere 4 enterprise that belongs to a cluster of Foundation vCenter 5.5.  I need to move all the guests off the coast of this host to be updated. This host has a client that is using the local hard disk as a data store.  This customer has six 6 hard drive with only using the local hard disk as a data store.  How can I move the hard drive to a different data store?

    When I try to use 'Move' or 'Migrate' with vCenter (client or web interface), it seems that I can move only data not store a single entity, each database individually.  Can we move a data store single someway with the guest always under tension, or do I have to power off and manually move the "vmdk" they reattach the hard drive?


    Thank you


    Bruce

    When you click on migrate, the data store, click on the Advanced button.  It will give you the option to select a disc.  You can migrate it while it is running.

  • Size of snapshot for VM with disks of different data warehouses

    Hi all

    We create a VM with drives C and D residing on different data stores. Size of drive C would be 30 GB and D would be 250 GB.

    When we take a snapshot of the virtual machine where it will be stored on C or D drive please confirm so we can design the size of the store of data accordingly.

    Kind regards

    Khurram Shahzad

    Snapshot is taken for both C & D drives,

    Instant c: drive will be in the data store where c: drive. Instant drive D will be in the data store were the unit.

  • View the data in different data control

    JDev 11.1.1.5.0 BPM

    I have a table from a data bean and control when clicking on a row of this table, I want to display data from another control on different data (Payload BPM) under the table in a form.

    How can I do this?

    Hello

    The payload BPM is exposed by a method I guess. This method takes an argument of the query (?). If this argument is for example an ID of the selected line then...

    1 create a valueAttribute binding by selecting the pageDef file. In the editor, choose the links, then generic link, AttributeValue. Select the iterator used by the table, and then the name of the attribute holding the ID to pass to the BPM method

    2. drag the result of BPM method to the page (and make it as a shape)

    3. the argument of the BPM method card for #{bindings.. inputValue}

    4. set the Partialtrigger property to the ID of the table panelFormLayout

    This should synchronize the form with the value selected in the table

    Frank

  • Cloning of VM/TIME to the different data store

    Hi all

    I am working out scripts excellent clone of Ruben garcia and one thing I'm trying to add is to have the VAPP created on a different data store.

    # Clone and move virtual machines
    {foreach ($vm to $vms)
    $vm = $vm | Get-opinion
    $vmname = $cloneName + "»" + $vm.name "
    . \LcloneVM $vm.name - cloneName '$vmname' - «$PortGroup» PortGroup
    Get-vm-name $vmname | Move-vm-destination $vapp;
    The virtual machine are getting cloned and then inserted in the passed TIME as a parameter name, but I can't understand how do to have the VAPP will be created on a data store that I specify. At this time the vApp is created on the same data store where the linked clones. Can I travel after from the user interface by using the migrate command but I want if possible to automate it.
    I thought that the next line should work but the VAPP fails when creating, so the move-vm command fails later.
    # Create VAPP
    $vapp = $host_name | VAPP-new-name "$cloneName" - data store "ThinDiskTesting"

    I am at a loss to what im doing wrong

    Post edited by: BrianRTS - difficulty of setting in the form

    You can specify the data store where you want to create linked clone delta files.

    This requires a slight modification to the script of Ruben

    # Generate specs for clone
    $cloneSpec = new-object Vmware.Vim.VirtualMachineCloneSpec $cloneSpec.Snapshot = $sourceVM.Snapshot.CurrentSnapshot $cloneSpec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec $cloneSpec.Location.DiskMoveType = [Vmware.Vim.VirtualMachineRelocateDiskMoveOptions]::createNewChildDiskBacking $cloneSpec.Location.Datastore = (Get-Datastore -Name $tgtDatastoreName).ExtensionData.MoRef
    

    Ownership of the data store is used to indicate where the clone should be placed.

    Or you want to create the clones, then move them?

  • Studio EQL erased when pointing to a different data field

    Hello

    I have this scenario with regard to the studio. The studio application has been set initially at DataDomain1. Then I put it in DataDomain2. Yet once, when I put the return of DataDomain1 none of the reports work!... It seems that all the EQL is erased and the configuration of the components is not retained. May I know the reason for this behavior. Is there a cure for keep an underlying the field of data even when application configuration settings is changed to a different area of data? Help you enjoy.

    Thank you

    Anusha

    That's exactly my point.  If the two data areas are totally different from each other, where is the value in preserving the configuration?  All components would not need to reconfigure?

    For example, let's say I have a configured component of guided Navigation to view the 5 groups of attributes.  Then, I want to pass the application that contains this component to point to a completely different data domain that does not have one of these groups of attributes (because, as you say, the two data areas are totally different).  What is the expected behavior?  I now have all of this configuration pointing to 5 groups of attributes that do not exist.  The configuration is totally disabled.

    Same would go for a chart bound to a view (example: 'Sales') with a bunch of parameters related to it based on some attributes.  If the data areas are totally different (as you said), the view would exist even in this new area of data?  Probably not, but let's say it was the case.  Are the same attributes?  They all do they exist?  What are their types?  By saying that the two data fields are totally different, you seem to indicate that the attributes would be totally different.  So even if the table had retained its configuration, the configuration would be totally useless and not valid?

    Now, there might be a portlet out there (say, a bar of Metrics) where the configuration is not valid but "fixable" (maybe?).  However, for the most part, you're views of design and configuration of the components for a data set.  When the underlying data is completely changed, the default behavior should be to keep around invalid configuration or slate?

    Note that if you want to change the data source connections in a given application (for example, I was bound to a Data Source that was limited to a few 'Sales' and I also wanted to include "Customers"), this feature is present in Application settings > connections to Data Source (with an option to keep the configuration).  However, I don't think that's what you're asking, and not what is intended by changing in the world of the field of data for an application.

    hope that helps.

    Patrick

  • Impossible to migrate from windows 2008 to the different data store

    Hai

    When I try to migrate the computer to the different data store I get the error

    "[error caused by file hard to]."

    Thank you

    Concerning

    R.Ramji

    Hello

    first move this virtual machine to another host and try to migration of storage. still, the problem you then close restarts the virtual machine host and try storage vmotion.

    It should work. If the problem continues after the error log.

  • How to select different data store for the snapshot

    Hello

    I connected with two data store ESXi 4 server. First data store is a local raid-5 HD and the second data store is a netgear NFS nas.

    virtual machines are stored on the local data store. I want to archivie snapshot for my virtual machine to use the second (nas NFS) data store. I tried to snapcho, but the disk data store is used is always the local.

    can I select a different data store to store the snapshot files?

    Thank you

    http://KB.VMware.com/kb/1002929 could help...

    / Rubeck

Maybe you are looking for

  • Update error 80072F78 (KB2656362)

    Hello I tried several times to install the following update: Security for microsoft.NET Framework 2.0 SP2 under Windows Vista SP2 and Windows Server 2008 SP2 x 86 (KB2656362), but I get the following error message: 80072F78. I tried windows quick fix

  • Conceal the identities of the people being sent by e-mail to

    How to hide the names?

  • PS6000 convert RAID5 in RAID10

    I have a PS6000 in a group of 3 members (in its own pool of storage) I want to convert RAID5 in RAID10. All LUNS have been removed, but the option to change from RAID5 to anything else is grayed out. How can I update?

  • Adding firepower of Services one ASA existing 5515 x

    I have a 5515cx ASA existing with an SSD. Material: ASA5515, 8192 MB RAM, 3059 MHz Clarkdale, CPU 1 CPU (4 cores) ASA: 4096 MB of RAM, 1 CPU (1 core)Internal ATA Compact Flash, 8192MBBIOS Flash MX25L6445E @ 0xffbb0000, 8192 KB Hardware encryption dev

  • Help, please! Photoshop CS2 crashing after a minute or two on my mac

    Thank you!Here's the report:Process: Adobe Photoshop CS2 [160]Path: / Applications/Adobe Photoshop CS2/Adobe Photoshop CS2.app/Contents/MacOS/Adobe Photoshop CS2ID: com.adobe.PhotoshopVersion: 9.0.2 (9.0.2x312 [20060822.902x312 02:00 break] 9.0.2x311