Spliting rows into multiple rows based on time interval

Hi experts need your help for framing query for the below scenarios
Scenario 1
Query should check for priority record(25), if the start_date and end_date of that priority record is the max in that group, records will not have any split.
output will be the same.
DC Store St Date End date Priority
955 3 1/1/2010 12/31/9999 25
966 3 4/5/2011 10/10/2011 50
977 3 10/12/2011 12/12/2012 100
output
DC store St Date End date Priority Rank
955 3           1/1/2010 12/31/9999 25 1
966 3           4/5/2011 10/10/2011 50 2
977 3           10/12/2011 12/12/2012 100 3
Scenario 2
If priority record is not covering the max range, then split the records as shown below,
1. during the time period 1/1/2011 & 4/30/2011 there were no other DC for that store so rank would be 1
2. the next range would be 5/1/2011 to 6/29/2011 we have 2 records in service so the record with low priortiy would be ranked 1 and second priority would be ranked 2
3. similarly, for 6/30/2011 to 10/1/2011 we have 3 records in service and it will be ranked accordingly on the priority.
DC Store St Date End date Priority
966 3 6/30/2011 10/1/2011 25
955 3 5/1/2011 11/30/2011 50
977 3 1/1/2011 12/31/2011 100
output
DC store St Date End date Priority Rank
977 3 1/1/2011 4/30/2011 100 1
955 3 5/1/2011 6/29/2011 50 1
977 3 5/1/2011 6/29/2011 100 2
966 3 6/30/2011 10/1/2011 25 1
955 3 6/30/2011 10/1/2011 50 2
977 3 6/30/2011 10/1/2011 100 3
955 3 10/2/2011 11/30/2011 50 1
977 3 10/2/2011 11/30/2011 100 2
977 3 12/1/2011 12/31/2011 100 1
Scenario 3
This works similar to scenario 2
DC Store St Date End date Priority
966 3 2/1/2011 12/31/2011 25
955 3 1/1/2011 12/31/2012 50
977 3 5/1/2011 06/31/2011 100
output
DC store St Date End date Priority Rank
955 3 1/1/2011 1/31/2011 50 1
966 3 2/1/2011 12/31/2011 25 1
955 3 2/1/2011 12/31/2011 50 2
977 3 5/1/2011 6/30/2011 100 3
955 3 1/1/2012 12/31/2012 50 1
Note: the number of rows coming in input will be dynamic and there are possibilities for the date ranges to overlap.

Hi,
Sorry, your requirement are unclear.
What role do dc, store and priority play in this problem? Prioriry obviously has something to do with how rows are split. Why is priority=25 special? Does the number 25 have some speciakl meaning, or does it just happen to be the lowest value of priority? Can 2 (or more) rows have the same priority? if so, can their dates overlap? Include examples in your sample data and results.
I think you want something like this:
WITH     all_dates     AS
     SELECT     st_date          AS a_date
     ,     priority
     FROM     table_x
    UNION ALL
     SELECT     end_date + 1     AS a_date
     ,     priority
     FROM     table_x
,     got_break_date     AS
     SELECT       a_date
     ,       LEAD (a_date) OVER (ORDER BY a_date)     AS next_date
     ,       MIN (priority)                     AS min_priority
     FROM       all_dates
     GROUP BY  a_date
,     paired_data     AS
     SELECT       x.*
     ,       b.*
     ,       GREATEST ( x.st_date
                       , b.a_date
                  )          AS s_date
     ,       LEAST ( x.end_date
                   , b.next_date
               )          AS e_date
     ,       RANK () OVER ( PARTITION BY  GREATEST (x.st_date, b.a_date)
                                   ORDER BY      x.priority
                      )        AS rnk
     FROM     table_x          x
     JOIN     got_break_date     b  ON   b.a_date     >= x.st_date
                       AND     b.a_date         <  x.end_date
                       AND     b.min_priority  <= x.priority
SELECT       dc
,       store
,       s_date          AS st_date
,       e_date - CASE
                   WHEN  rnk     = 1
                 AND   end_date     = e_date
                 THEN  0
                 ELSE  1
               END          AS end_date
,       priority
,       rnk
FROM       paired_data
ORDER BY  s_date
,            priority
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data, formatted, between \ tags.  See the froum FAQ {message:id=9360002}
Point out where the results of the query above are wrong, and explain, using specific examples, how you get those results from the given data in those places.
Always say what version of Oracle you're using.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • How to Split 1 Order into Multiple Deliveries based on Partner Function ?

    Hello,
    How can I split one Sales Order into multiple deliveries, based on the partner function "managed by" ?
    The requirement is that one order will be created for different "managed by".
    If partner function "managed by" is same at line item level in order, than the items having same "managed by" can be combined in one delivery, else delivery will split and multiple deliveries will be created from 1 Order.
    Jatin Mistry

    Hi,
    You need to create a new requirement in tcode VOFM for that, together with your ABAP consultant. This requirement will be used in copy contol.
    http://saptechsolutions.com/pdf/VOFMCopyRequirementRoutines.pdf
    MdZ

  • Splitting the single record into multiple records based on validity

    Hi Guru's,
    basically i am an BI consultant with less knowledge on ABAP, can i request your help on the ABAP task.
    I am working on HR module which is integrated with SAP BI,  the reports will be executed based on calendar month the requirement is i should split the single record into a multiple records based on validity of the record.  basically the HR data would be in data from and date to. 
    below is the logic
    Check whether the start and end date of the record are in the same month and year.
    If yes  nothing changes
    If no  create multiple records
    1st record  original start date of the record u2018till end of that month
    Following record  1st of the next month  u2018till last day of the month
    u2026
    Last record  1st of the month u2018till original end date.
    All fields will have the same values, only the datefrom and dateto fields change.
    Can any one please provide me the same code to proceed on my task.
    Thanks and Regards,
    Venkat

    Hi,
    Using Rule group we can split it.
    Using Rule Group in SAP-BI  Part - 1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/using%20rule%20group%20in%20sap-bi%20%20part%20-%201.pdf
    Thanks
    Reddy

  • During import, how to auto split one project into multiple albums based on date?

    I believe I've done enough aperture reserach to get all my terminology right, so here goes...
    I've created a file structure within the aperture inspector the the tune of: 
    Year [folder], Type of event (Occasion, special occasion, holiday, vacation) [folder], Project (Wedding), Album (i.e. Day 1, Day 2 or Pre wedding week, event, honeymoon).
    I also have entire months with 7 or 8 pictures each day, that are of the same type/project (random dog pictures) but are distinctly different days (albums - day in park, in bed at night, watching movie). 
    My question is, can I import one project with multiple albums already created based on the date they're taken.  As I can see it, all I can do is split individual projects automatically by date.  But what if one project is over one month, but has multiple distinct days that would be ideal for albums?  One more example.  We did a trip to San Fran.  One day was touring the city, one day was a concert, another day was touring the city.  All one project, but 3 different albums (in my mind).  I had to import as one project, then separately go in and make albums.  I would like that done automatically.
    My suspicion is that I can not natively do this within aperture, and that I would need something called an "applescript."  I haven't done any reserach into that area, so if that's the case and you know where I can find a script that would do this, I'd appreciate the help. 
    Sorry for the wordiness, just wanted to be clear.  Thanks for any and all help!

    Hi,
    You need to create a new requirement in tcode VOFM for that, together with your ABAP consultant. This requirement will be used in copy contol.
    http://saptechsolutions.com/pdf/VOFMCopyRequirementRoutines.pdf
    MdZ

  • How do I divide my iTunes library into multiple libraries based on unique Apple ID?

    I have one iTunes library on my iMac that started with just me.  As each of my kids and my husband got their own Apple IDs, all of their purcahses are loaded into my library.  They have their own IDs because each has their own phone/iPod/iPad and is responsible for paying for their purchases through their own accounts.  We decided to use only my computer so we could share content.  But Apple restricts each device from having content from more than 5 IDs anyway. 
    Now, I really don't want my kids stuff anymore though they may want some of my music (which I imported from CDs for the most part).  I learned how to create a new library but I don't understand how to move content into each library.  Would it make more sense for each kid to set up iTunes on his own computer?  If so, how do I move the content from my Mac to their computer, when it's not my entire iTunes library moving?
    Thanks in advance for your help

    Duplicate the entire library, then in each copy throw away the content that you don't need.
    You can duplicate the iTunes library by copying the folder to a new location.
    You can switch between libraries by holding down shift as you start iTunes.
    iTunes uses the name of the folder as it's window title. You could, for example, rename the copied folder as "Bob's iTunes" and the original as "Alice's iTunes", assuming the two people in question are called Alice and Bob.
    tt2

  • Spliting reports into multiple reports with unique data

    I have a report which looks like
    ID   TITLE    DATE
    1   ABC COrp  05/04/2009
    2   XYZ COrp  05/04/2009
    3   STR Corp  05/05/2009
    4   NYC Corp  05/05/2009
    5   PHL Corp  05/06/2009
    6   ZAP Corp
    If I Enter date in the prompt selection as 05/04/2009, it will display two records
    so when I do report bursting or export...I need to split those 2 records into two different reports or pdf's.
    report 1 will have the following data
    ID        TITLE           DATE                                       
    1       ABC Corp       04/30/2009
    report 2 will have the following data
    ID         TITLE            DATE
    2         XYZ COrp       04/30/2009
    How can we implement this??

    CR does not support this functionality directly

  • Limit connection based on time interval

    Hi everyone.
    I would like to know, how can i limit a user to connect the database on specific times? For example i want the db user to be able to connect only after 11:00 PM, to 08:AM. Is this possible?

    Hi Emre. As Ados has suggested, you need to create a logon trigger. Look at below example:
    C:\Documents and Settings\Administrator>sqlplus "/as sysdba"
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 28 14:56:58 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> create user kam identified by kam;
    User created.
    SQL> grant connect, resource to kam;
    Grant succeeded.
    SQL> conn kam/kam
    Connected.
    SQL> disc
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr
    oduction
    With the Partitioning, OLAP and Data Mining options
    SQL> conn / as sysdba
    Connected.
    SQL> CREATE OR REPLACE TRIGGER limit_connection
      2     AFTER LOGON ON DATABASE
      3  BEGIN
      4     IF USER = 'KAM' THEN
      5        IF to_number(TO_CHAR (SYSDATE, 'hh24')) BETWEEN 8 AND 22
      6        THEN
      7           RAISE_APPLICATION_ERROR(-20998,' Dear user '||USER||'! You can''t login between 08 and 22');
      8        END IF;
      9     END IF;
    10  END limit_connection;
    11  /
    Trigger created.
    SQL> select to_char(sysdate,'hh24') from dual;
    TO
    23
    SQL> conn kam/kam
    Connected.
    SQL> select to_char(sysdate,'hh24') from dual;
    TO
    18
    SQL> conn kam/kam
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20998:  Dear user KAM! You can't login between 08 and 22
    ORA-06512: at line 5
    Warning: You are no longer connected to ORACLE.
    SQL>- - - - - - - - - - - - - - - - - - - - -
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Group by based on time interval

    Hi,
    I have grouped the log count for every one hour for the past one month. No I wanted to find the minimum (Hour with minimum logs) for each day. Could you please help me out?
    The below query doesn't work:
    select to_char(HOURLY, 'MM/DD/YYYY HH24:MI:SS'), min(sms) from
    (select trunc(createdate,'hh24') + (trunc(to_char(createdate,'mi')/60)*60)/24/60 HOURLY, count(*) sms
    from testlog
    where createdate >= to_date('01/01/2013', 'MM/DD/YYYY')
    group by trunc(createdate,'hh24') + (trunc(to_char(createdate,'mi')/60)*60)/24/60)
    group by to_char(Hourly, 'MM/DD')
    I get ORA: 00979 error. Could some one help me out?

    Hi,
    Welcome to the forum!
    985680 wrote:
    Hi,
    I have grouped the log count for every one hour for the past one month. No I wanted to find the minimum (Hour with minimum logs) for each day. Could you please help me out?
    The below query doesn't work:
    select to_char(HOURLY, 'MM/DD/YYYY HH24:MI:SS'), min(sms) from
    (select trunc(createdate,'hh24') + (trunc(to_char(createdate,'mi')/60)*60)/24/60 HOURLY, count(*) sms
    from testlog
    where createdate >= to_date('01/01/2013', 'MM/DD/YYYY')
    group by trunc(createdate,'hh24') + (trunc(to_char(createdate,'mi')/60)*60)/24/60)
    group by to_char(Hourly, 'MM/DD')
    I get ORA: 00979 error. Could some one help me out?Right. In the outer query, you're GROUPing BY
    to_char(Hourly, 'MM/DD') but in the SELECT clause , you're trying to reference
    to_char(HOURLY, 'MM/DD/YYYY HH24:MI:SS')which is not the same as the GROUP BY expression, and does not depend on the GROUP BY expression.
    It sounds like you want something like this:
    WITH  hour_summary      AS
         SELECT       TRUNC (createdate, 'HH')     AS hour
         ,       COUNT (*)                    AS hour_cnt
         ,       RANK () OVER ( PARTITION BY  TRUNC (TRUNC (createdate, 'HH'))
                                       ORDER BY      COUNT (*)
                          )             AS day_rank
         FROM       testlog
         WHERE       createdate     >= TO_DATE ( '01/01/2013'
                                     , 'MM/DD/YYYY'
         GROUP BY  TRUNC (createdate, 'HH')
    SELECT       hour
    ,       hour_cnt
    FROM       hour_summary
    WHERE       day_rank     = 1
    ORDER BY  hour
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    You'll get better replies sooner if you always include this information whenever you have a question.

  • Splitting rows at specific times (not intervals)

    Greetings.
    I have a data set with fields that hold start and end times for specific events. These events have unique ID's and cross multiple time intervals. I'm looking for a way to split a single row in the dataset into multiple rows with new start and end times for each relevant time interval.
    The examples I've found online describe ways (using the MODEL method) to split rows based on time intervals of a fixed length (24 hours, for example) but I'm looking for a way to split the records at a specific time (at 6am and 6pm.)
    So this record set:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 27-SEP-11 04:38:11</tt>
    Would become:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE MODEL...
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 18:00:00
    1228322 __ 21-NOV-11 18:00:00 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 21-NOV-11 18:00:00
    1228327 __ 21-NOV-11 18:00:00 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 25-SEP-11 18:00:00
    1183267 __ 25-SEP-11 18:00:00 __ 26-SEP-11 06:00:00
    1183267 __ 26-SEP-11 06:00:00 __ 26-SEP-11 18:00:00
    1183267 __ 26-SEP-11 18:00:00 __ 27-SEP-11 04:38:11</tt>
    Notice that record 1183267 starts in one interval, crosses two whole intervals and ends in a fourth. This splitting of one event into many is required to create a record set that will guarantee a record for each of the relevant intervals.
    Thanks in advance for your consideration!

    SonyDADCuser wrote:
    Greetings.
    I have a data set with fields that hold start and end times for specific events. These events have unique ID's and cross multiple time intervals. I'm looking for a way to split a single row in the dataset into multiple rows with new start and end times for each relevant time interval.
    The examples I've found online describe ways (using the MODEL method) to split rows based on time intervals of a fixed length (24 hours, for example) but I'm looking for a way to split the records at a specific time (at 6am and 6pm.)
    So this record set:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 27-SEP-11 04:38:11</tt>
    Would become:
    <tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE MODEL...
    _ ID __________ Start_date __________ End Date _____
    1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 18:00:00
    1228322 __ 21-NOV-11 18:00:00 __ 21-NOV-11 19:32:27
    1228327 __ 21-NOV-11 14:53:24 __ 21-NOV-11 18:00:00
    1228327 __ 21-NOV-11 18:00:00 __ 22-NOV-11 03:46:06
    1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
    1183267 __ 25-SEP-11 16:09:13 __ 25-SEP-11 18:00:00
    1183267 __ 25-SEP-11 18:00:00 __ 26-SEP-11 06:00:00
    1183267 __ 26-SEP-11 06:00:00 __ 26-SEP-11 18:00:00
    1183267 __ 26-SEP-11 18:00:00 __ 27-SEP-11 04:38:11</tt>
    Notice that record 1183267 starts in one interval, crosses two whole intervals and ends in a fourth. This splitting of one event into many is required to create a record set that will guarantee a record for each of the relevant intervals.
    Thanks in advance for your consideration!Neat problem.
    This assumes you have a reasonably recent version of Oracle, and i only tested it for your "complex" case spanning multiple days because i didn't want to type out a bunch of sample data. Should work on all your data sets though (i always say this when i do incomplete testing :).
    with
      time_data as
      select
          1                                                         as col1
        , to_date('25-sep-2011 16:09:13', 'dd-mon-yyyy hh24:mi:ss') as start_date
        , to_date('27-sep-2011 4:38:11', 'dd-mon-yyyy hh24:mi:ss')  as end_date
      from dual
    select *
    from
      select
          col1
        , greatest
              trunc(t.start_date, 'dd') - interval '6' hour + (interval '12' hour * m.column_value)
            , t.start_date
          ) as start_date
        , least
              trunc(t.start_date, 'dd')  + interval '6' hour + (interval '12' hour * m.column_value)
            , t.end_date
          ) as end_date
      from time_data t,
        table(cast(multiset(select level from dual connect by level <= ceil(end_date - start_date) * 2) as sys.odcinumberlist)) m
    where start_date < end_date;

  • Split XSLT Output into Multiple Files

    I have an XML-to-File scenario working, but now I need to split my XSLT map output into multiple files based on the data.  I have been reading the Jin Shin blog on message splitting, but don't know that it pertains to my situation.
    XML data getting mapped with XSLT map creates output formatted like this.
    <?xml version="1.0" encoding="utf-8"?>
    <ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice">
    <Header>
      <RecordID>HDR</RecordID>
      <InvoiceNumber>15</InvoiceNumber>
    </Header>
    <Details>
      <RecordID>DTL</RecordID>
      <LineItemNumber>001</LineItemNumber>
      <UnitPrice>1.25</UnitPrice>
    </Details>
    <Details>
      <RecordID>DTL</RecordID>
      <LineItemNumber>002</LineItemNumber>
      <UnitPrice>2.22</UnitPrice>
    </Details>
    <Header>
      <RecordID>HDR</RecordID>
      <InvoiceNumber>16</InvoiceNumber>
    </Header>
    <Details>
      <RecordID>DTL</RecordID>
      <LineItemNumber>001</LineItemNumber>
      <UnitPrice>3.33</UnitPrice>
    </Details>
    </ns1:ColdInvoiceData>
    I currently have this output writing to a file (FTP, File Conversion).  A single file is no issue, but I need to send multiple files for every set of HDR/DTL(s).  I also need to put the invoice number in the filename (which is working fine as a parameter in my single FTP File CC now).
    Can I make this happen with message splitting and maybe a second map (GUI map)?  Do I need to adjust the XSLT output XML format to have an invoice level?  Is there a better way to go?
    Thanks!

    I made a change to the namespace used on the Messages/Message1 nodes (since the system-assigned ns0 was already being used in my xml data) and now I am getting output. 
    The problem is that the output matches my input.  As aforementioned, I started with just a one-to-one mapping on every node and field. 
    When I change the mapping to try to force multiple ColdInvoiceData nodes, I get the following error (when my source has two Invoice nodes):
    <Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:Messages/ns0:Message1/ns1:ColdInvoiceData[2]/Invoice. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at
    When my source has one invoice node, it works ok.
    Here is a screenshot of my mapping structure.
    http://webpages.charter.net/kpwendel2/ib.jpg

  • How can I split an Orders05 iDoc into multiple iDocs?

    Hello,
    Can one of you experts please tell me how I can split an ORDERS05 iDoc into multiple iDocs based upon Delivery addresses? 
    For example, if the iDoc contains 3 different Delivery Addresses then I need to split it into 3 iDocs.
    It has been suggested to me that I can Create a custom function module. In this custom fm split the idoc into 3 based on the delivery address and create it using the FM MASTER_IDOC_DISTRIBUTE.
    Problem is I don't know how to do this.  Any help is greatly appreciated.  Thanks.
    Dan

    Hi Dan Avis
    Write a Custom  Z program .
    1 get order05 idoc number....
    2 get the segment details...(Based on you condition...)
    3 In a loop  send the data to the FM MASTER_IDOC_DISTRIBUTE  (Based on you condition...)
    4 IDOC will generated,,,every loop and
    5 Change the status of original idoc .
    or
    Create Function module and use the FM as process code to create 3 idocs...and processs...new generated idoc and block original idocs...
    Call me if you have questions  @ 302 290 5677
    Thanks
    Ramesh

  • I can't split a home DVD into multiple events. Why?

    I have a DVD of old super 8 movies that I converted into a DVD years ago and want to extract selected segments as short movie clips. I have been able to load the entire DVD as a single event but I wanted to break this single event into multiple events based on various themes. My problem is that I don't seem to be able to split the content at all. The "Split event before selected Clip" always appears to be grayed out. What am I doing wrong?
    paulfromcrystal

    I just figured it out.  Somehow I didn't change it to the correct code of 1.  So on the second shot of 5 allowed I realized I didn't change and save.  Now the dvd played.

  • Cats ESS view - into multiple rows when we release times or refresh them

    Dear ALL,
    We are using the record working times and when we enter the data for the week for 5 days each with 8 hours a day in one row in portal. Once we refresh or review that page it is resulting into multiple rows, like for 5 days five rows each row containing an entry for each day. how can we avoid this, we want all entries maintained into one row only.
    Help is appreciated.
    Thanks and Regs,
    Raj

    Made some changes in Data entry profiles

  • Split single row into multiple rows containing time periods

    Hi,
    I have a table with rows like this:
    id, intime, outtime
    1, 2010-01-01 00:10, 2010-01-3 20:00
    I would like to split this row into multiple rows, 1 for each 24hr period in the record.
    i.e. The above should translate into:
    id, starttime, endtime, period
    1, 2010-01-01 00:10, 2010-01-02 00:10, 1
    1, 2010-01-02 00:10, 2010-01-03 00:10, 2
    1, 2010-01-03 00:10, 2010-01-03 20:00, 3
    The first starttime should be the intime and the last endtime should be the outtime.
    Is there a way to do this without hard-coding the 24hr periods?
    Thanks,
    Dan Scott
    http://danieljamesscott.org

    Thanks for all the feedback, Dan.
    It appears that the respective solutions provided will give you: a) different resultsets and b) different performance.
    Regarding your 'truly desired resultset' you haven't answered all questions from my previous post (there are differences in the provided examples), but anyway:
    I found that using CEIL or ROUND makes quite a difference, using my 'simple 3 record testset' (30 records vs. 66 records got initially returned, that's less than half of the original). That's quite a difference. However, I must call it a day (since it's almost midnight) for now, so there's room for more optimizement and I haven't thoroughly tested.
    But this might hopefully make a difference performancewise when compared to my previous 'dreaded example':
    SQL> drop table t;
    Table dropped.
    SQL> create table  t as
      2  select 1 id, to_date('2010-01-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-01-03 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
      3  select 2 id, to_date('2010-02-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-02-05 20:00', 'yyyy-mm-dd hh24:mi') outtime from dual union all
      4  select 3 id, to_date('2010-03-01 00:10', 'yyyy-mm-dd hh24:mi') intime, to_date('2010-03-03 00:10', 'yyyy-mm-dd hh24:mi') outtime from dual;
    Table created.
    SQL> select id
      2  ,      max(intime)+level-1 starttime
      3  ,      case
      4           when level = to_char(max(t.outtime), 'dd')
      5           then max(t.outtime)
      6           else max(t.intime)+level
      7         end outtime
      8  ,      level period      
      9  from   t
    10  connect by level <= round(outtime-intime)
    11  group by id, level
    12  order by 1,2;
            ID STARTTIME           OUTTIME                 PERIOD
             1 01-01-2010 00:10:00 02-01-2010 00:10:00          1
             1 02-01-2010 00:10:00 03-01-2010 00:10:00          2
             1 03-01-2010 00:10:00 03-01-2010 20:00:00          3
             2 01-02-2010 00:10:00 02-02-2010 00:10:00          1
             2 02-02-2010 00:10:00 03-02-2010 00:10:00          2
             2 03-02-2010 00:10:00 04-02-2010 00:10:00          3
             2 04-02-2010 00:10:00 05-02-2010 00:10:00          4
             2 05-02-2010 00:10:00 05-02-2010 20:00:00          5
             3 01-03-2010 00:10:00 02-03-2010 00:10:00          1
             3 02-03-2010 00:10:00 03-03-2010 00:10:00          2
    10 rows selected.
    SQL> By the way: I'm assuming you're on 10g, is that correct?
    Can you give us some information regarding the indexes present on your table?

  • I need to divide selected row into multiple rows when i navigate  ADF 11g

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I need to divide selected row into multiple rows when i navigate to other page . Scenario - in first page i'm displaying some records with columns like empno , empstatus , empworkdepts ,curdepts
    Here empworkdepts gives the numeric number like no of departments work shifts 3 or 4 or 5. when i select any particular employee and fire next button to navigate next page.I have to divide the selected employee with same information into multiple times based on the empworkdepts value.
    empno empstatus empworkdepts curdept
    001 eds 2 TS
    002 hr 1 FO
    003 eds 4 TS
    *004 eds 3 TS*
    now i selected employee 004 , when i navigate to next page.
    Empno EmpStatus EmpWorkDepts CurDept
    004 eds 3 TS
    004 eds 3 TS
    004 eds 3 TS
    i did with java code in bean .but not stable .
    any help............
    thanks advance.............
    Edited by: user9010551 on May 5, 2010 10:48 PM
    Edited by: user9010551 on May 10, 2010 11:31 PM

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

Maybe you are looking for

  • Problems using DBMS_PIPE package

    Hi! Im using the SQL Navigator for Oracle to develop PL/SQL code and now I've got a problem with the DBMS_PIPE package. When i use the methods like create_pipe etc. in a normal pl/sql window it works without problems. But when i place such a DBMS_PIP

  • I-Pod Classic

    The last 4 songs I purchased from Amazon are in my I-tunes library on my computer, when I try to sync and upload to my Ipod classic, I receive an Unknown error has ocurred and they will not upload to my Ipod.

  • How to call subscreen and provide selection screen in subscreen

    Hi experts, please anybody suggest me how to call subscreen in module pool screen and provide selection screen in that sub screen. please tell me how to design this subscreen in module pool screen. adevanced thank you regards vijay krishna

  • Notification to defined users for Material master specific field changes

    Dear All, I would like to check the feasibility and way to fulfil the below requirement. We would like to send notification per mail or Pop UP to the defined users whenever there is a change in particular filed in Material Master (Like MVKE-VMSTA) us

  • Clone meeting planner when creating - keyboard shortcut?

    I create numerous monthly meetings that take place at different times (so recurring meeting doesn't work).  I would swear I had found a shortcut to clone the meeting with details included (attendees/subject/location) with two short keystrokes and the