Date difference between the Date of end of first row and the Start Date of the second row

Hello

I have data as follows:
Seq_No      Plant_No      Start_date          End_Date
148          A124         13/Jul/10           12/Oct/10
210          A124         13/Oct/10           09/Jan/11 
In the real world scenario, there would be more lines.

I would like to take the difference in date between front-line end_date and start_date to second line.

How can I do this?

Concerning

Published by: user400 on November 7, 2010 08:46

I'm guessing you want something like

SELECT seq_no,
       plant_no,
       start_date,
       end_date,
       lead(start_date) over (partition by plant_no order by start_date) start_date_of_prior_row,
       end_date - lead(start_date) over (partition by plant_no order by start_date) diff_in_days_btw_rows
  FROM your_table

Justin

Tags: Database

Similar Questions

  • What is the difference between the external SCSI cables and cables data acquisition

    Hi all, I would like to make a simple extension using an external SCSI cable and a NOR 184749/SH 6868. In other words, it would be: female HD68 bolt of the cable ends OR coupled to an external SCSI HD 68 male with a VHDCI 68 male cable. What are the differences between the external SCSI cables and cables as the (M) 6868EP of the CHS data acquisition. Other than the sex of the end of HD68 is usually on one. How is the posting hit buy using an external SCSI cable for an extension to tell a BNC-2090?

    Yes, I realize that NEITHER wants us to buy their cable, but in these economic times difficult, to do use all available resources, so I have to try,.

    Thank you

    joelowwatt

    Hello

    As long as you have compatible connectors, SCSI cables will work DAQ of basic functions.  They have the advantage of NO cables is that we can meet our DAQ hardware.  So, we can create pairs twisted differential pairs to HAVE, using the ground for shielding terminals and generally specialize the cable to minimize noise and crosstalk.  Because the SCSI cables are not specialized, you are likely to see the most noise and, if you go the sampling rates more Rapids, crosstalk.  If you are in a laboratory or factory with a good amount of noise EMF that your readings are not quite as clean, or if you have fluorescent lights you might see 60 Hz noise you might not see otherwise.

    If you want more details on the specifications of the SH68-68-EPM cable, I recommend these two articles.  The first example of the twisted pair and the principles of the SH cable shielding and the second gives the most precise specifications that you can compare with when looking for a SCSI cable.

    3GRD4C33 Knowledge Base: mapping list of the sons of SHC68-68-EPM & SH68-68-EPM cable

    1TGEHPDM knowledge base: detailed specifications for the SH68-68-EP cable

    Kind regards

  • What is the difference between the cat of the IR and IR data files in lightroom it please

    I have cat IR and IR data files in my backup. These two are big files of 500 MB, 900 MB respectively. My understanding is that these records did not contain real images but only thumbnails with the mods of lightroom. What is the difference between the cat of the IR and IR data files and should I make a second copy of both or the cat IR file

    The.lrcat is the file in your catalog. This is an important safeguard.

    The .lrdata files have previews. These can always be regenerated from the library, but it could take some time a large catalog.

    It is advisable to save them both. But if you are short on disk space, save the .lrcat file.

  • differences between the Data Pump to back up the database and use RMAN?

    What are the differences between the Data Pump to back up the database and use RMAN? What is DISADVANTAGES and BENEFITS?

    Thank you

    Search for the backup of the database in

    http://docs.Oracle.com/CD/B28359_01/server.111/b28318/backrec.htm#i1007289

    In brief

    RMAN-> physical backup. (copies of the physical database files)

    DataPump-> logical backup. (logical data such as tables, procedures)

    Docs for RMAN-

    http://docs.Oracle.com/CD/B28359_01/backup.111/b28270/rcmcncpt.htm#

    Datapump docs

    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/dp_overview.htm

    Published by: Sunny kichloo on July 5, 2012 06:55

  • Calculation of the difference between the dates.

    All,
    I have a requirement where I need to calculate the difference between the dates. If the given date is less than the current date, it should return '0' (zero) other wise should return 1. How can I do this?

    Kind regards
    Vinciane

    and with a CASE statement...

    SQL> ed
    Wrote file afiedt.buf
    
      1  select case when to_date('01/11/2008','DD/MM/YYYY') /
    
      DATECOMP
    ----------
             0
    
    SQL>
    
  • Difference between the timings

    Hello

    I have a table like timings list both moves day and night.

    And saw the time (varchar) column and a time (varchar).

    difference between the timings

    in the time of expiration time

    case 1 (day shift): 06:00:00 23:00

    case 2(Night Shift) 23:00 07:00

    Hello

    You want solutions that work?  Then make sure that the CREATE TABLE and INSERT statements you post too much work.  Test (and, if necessary, correct) them before posting.  Among other errors, the INSERT statements that you posted have unbalanced parentheses, and you try to put 5 values in 4 columns.  Also, do not attempt to INSERT a value of VARCHAR2, as August 19, 2014 ", in a DATE column."  TO_DATE allows to convert strings to DATEs.

    If, for example, in_time =' 06:00:00 'and out_time = 23:00:00 ', is that 17 hours?  How do you know that it's not 41 hours or 65 hours?

    If you are assuming that this out_time is in_time (if is a moment later) the same day or the next day (although out_time is earlier than in_time), then you can do something like:

    (TO_DATE (outtime, 'HH24:MI:SS')

    -(TO_DATE (respondent, 'HH24:MI:SS')

    -CASE

    WHEN respondent<=>

    THEN 0

    1. OTHER

    END

    )

    ) * 24

    Notice how much more complicated it is that expression I posted earlier, which is what you would need if you used DATE columns.  It will therefore be slower, as well.  Also, this can trigger an error and do not return results at all if there is typo in one of the in_time or out_time columns.  As mentioned previously, it makes no allowance for 24 hours changes (or), and there are 3 columns in your table, instead of 2.

  • What is the difference between the 2 procedures pls. ?

    What is the difference between the 2 procedures in syntax and bussiness pls.

    CREATE OR REPLACE PROCEDURE Balance_quantity_update
        (V_STORE_ID IN NUMBER,  V_ITEM_SERIAL IN NUMBER) IS
      BEGIN
      UPDATE WH_T_ITEMS A
          SET BALANCE_QTY = ITEM_QTY
          WHERE STORE_ID = V_STORE_ID
          AND ITEM_SERIAL = V_ITEM_SERIAL
          AND ITEM_QTY = (SELECT MAX(ITEM_QTY)
                          FROM WH_T_ITEMS B
                          WHERE A.STORE_ID = B.STORE_ID
                         AND A.ITEM_SERIAL = B.ITEM_SERIAL);
       END;
       /
    CREATE OR REPLACE PROCEDURE Balance_quantity_update
        (V_STORE_ID IN NUMBER,  V_ITEM_SERIAL IN NUMBER) IS
      BEGIN
      UPDATE WH_T_ITEMS A
          SET BALANCE_QTY =MAX(ITEM_QTY)
          WHERE STORE_ID = V_STORE_ID
          AND ITEM_SERIAL = V_ITEM_SERIAL   ;
       END;
       /
    Kind regards

    Abdetu...

    I don't know exactly what you're asking. The query

    UPDATE WH_T_ITEMS A
       SET BALANCE_QTY =MAX(ITEM_QTY)
     WHERE STORE_ID = V_STORE_ID
       AND ITEM_SERIAL = V_ITEM_SERIAL   ;
    

    is not valid SQL from Oracle. As MAX aggregate functions cannot be used in a query like that because Oracle has no idea what you aggregate by. There is nothing preventing Oracle to change the syntax of the SQL language to allow an aggregate be used this way, but there is usually no reason to extend the SQL language like that.

    You can assign the result of a query that included a total of BALANCE_QTY column, i.e.

    UPDATE WH_T_ITEMS A
       SET BALANCE_QTY = (SELECT MAX(ITEM_QTY) FROM <> WHERE <>)
     WHERE STORE_ID = V_STORE_ID
       AND ITEM_SERIAL = V_ITEM_SERIAL   ;
    

    I think I mentioned in some of your previous discussions, a data model where you have a table of ELEMENTS that has an ITEM_QTY and the BALANCE_QTY looks suspicious. You assign the value of the ITEM_QTY column to the BALANCE_QTY on the same line does only increase anxiety.

    Justin

  • What is the difference between the CACHE and the PIN code?

    What is the difference between the CACHE and the PIN code?

    Cached, it's when you specify CACHE as part of a CREATE or ALTER an object to say Oracle when the blocks are retrieved this object these blocks should be put to the most recently used end of the LRU (least recently used) list in the buffer cache when a full table scan. Under normal circumstances, when the blocks are retrieved in memory, in that they are placed least recently used end of the LRU list. This means that the data that was most recently viewed typically will remain available in the cache buffers for awhile. Therefore, subsequent runs of the same query should find these blocks already in the buffer cache and not to recover disk again. When you use the CACHE, you say you want to put the blocks retrieved at the end of the list, which means that they will be the first blocks "aged" off the buffer cache when more space is needed.
    A few reasons to use the CACHE are:
    (1) for tables of small (only a few blocks that must be read to retrieve the entire table).
    (2) when you do a select statement returns a huge amount of data, and you do not necessarily have if wait for the query to run any time soon. In both cases, you give Oracle an opportunity to eliminate the blocks quickly to make room for more 'necessary' blocks instead of having to follow in the LRU list.

    Pinning is when you want to keep the objects in memory and to prevent them from being aged by the normal mechanism of the LRU. You use the INVALIDHTOMEH to "pin" PL/SQL code in memory, so that users are not experiencing intermittent slowdowns when code gets years out of the shared pool and must be recharged.

    The bottom line is that caching can blocks be moved quickly while pinning retains the information in memory to avoid the re-loads.

  • What is the difference between the export photos and pictures of unmodified export

    I'm trying to export my library of photos of 30 GB on a hard drive. When you choose file > export gives two options: export the Photos... and export Unmodified Original...

    Is there a difference between the two options?

    When I export the location data is backed up?

    The original unmodified are image files full-size that have been imported into the library at the start.

    Export Photos will give you the edited version (if it is edited).  Also, you will have a chance to change the size of the file (Mbs) and/or the image (pixels) size when exporting and to change the JPEG, tiff or png.

  • How to read the voltage difference between the 2 pins of a RS232?

    Hi, I'm new in this field and I'm having a problem in the acquisition of data from a RS232 port. In fact, I don't know if it is possible to do.

    What I would do, is to read the voltage difference between the two pins of the port. It's because I want to measure the temperature (and save the data) in a very simple way. I have 6 thermocouples and I thought weld at the different pins of the RS232 interface and acquire analog signals in mV with the computer. Then, I would use a thermometer to calibrate the values.

    Is it possible to do? How? I searched a lot but I can't find any tutorial or similar to this example...

    No, it is not possible to do it with the serial port. The port is not an A/D converter. A simple RS-232 tutorial will tell you that the port is binary in nature.

  • difference between the real time module and module fpga

    Hi experts,

    I was wondering if someone could tell me the difference between the FPGA and the module in real time (in short).

    My understanding is that the FPGA module facilitates code LV that can then be designed for the specific advice of RIO, I have used this a bit in the past.

    The real time module, I'm a little more unsure about, all I know is that it allows the creation of a 'real time' i.e. deterministic environment.

    My request is this: I wish I had several control loops running on two tables of RIO, with the host PC mainly used for recording data and user interface. I see that I have no need of RT on the host (Win XP should be good).

    Do I need the RT module?

    You are right.  In the scenario you describe, you won't need to LabVIEW RT. LabVIEW RT is used to create a deterministic execution on specific targets for intel such as the PXI-8106 and PXI-8108.  You can still use strings and floating point on RT.

  • What is the difference between the IO and line?

    Hi all

    I'm using Labview 7 and in my mahcine I have an installed 6013 card. However, there was an interface card designed by someone else long ago, on the table, only AO0, AO1,..., A07, DIO0, DIO1,..., DIO7 were printed. In the program, I saw some code to write to digital Line.vi allows you to send data to the digial io. Say that I write for DIO 3, so I understand here DIO 3 means the channel of e/s 3, but online? What is the difference between the channel and the line? When I write the data to a single channel of e/s, are us wriitng a byte or a bit of it? Thank you.

    A channel is usually used with inputs/outputs analog.  Each AI or AO is a string.

  • What is the difference between the VI of the histogram and the General histogram VI?

    Hello

    I did a google search and forum for this and came up empty. I would like to know if there should be a difference in how the work of both?

    I ask because I gave exactly the same table both X and was two different results, unless I also specified the interval bins / # to be equal for each of them. (level for the VI histogram and #bins for the general histogram VI)

    It also means I want to know the difference between the intervals and #bins? They are the same thing with different names just?

    It's more of a general idea on how the two screws work to obtain a specific solution to a problem, anyway, so any help is appreciated

    Thanks in advance.

    Pladio wrote:

    Thank you. No idea why the same data would give different histograms when the specification is not garbage?

    Yes.

    The normal VI, if you do not connect the entry "interval", will give you 10 bins, becaue that entry is set by default to 10.

    The advanced VI, if you do not connect the "#bins" of entry, will give you a number of bins from comment how are made, or the size of the incomming table. This number is 1 + 3.3 log n, where n is the size of the array. This is called rule of Sturges, and is more or less explained in the programming of this VI. Open it and look at it.

  • What is the difference between the stop and restart?

    What is the difference between the stop and restart?  I feel that stopping closed all processes, completely erases RAM memory and clears the cache of the processor.  I need to know if 1) this is a correct assumption and 2) which is better for daily maintenance of the system.  Thank you in advance.

    Hello Jeremy_1976,

    Your support when the judgment is correct. Basically, it stops the process and completely turns off your computer. Reboot, however, temporarily your PC stops, then turn it on again. This happens usually when Windows updates are installed. After installation, the system is restarted (rebooted) so that any update has been successfully installed and works as it should. You can be a little mixed upward the reboot and the hibernation. Reboot is, as I have indicated previously, basically a reboot of your machine. Ultimately, your PC is on again after a reboot. However, hibernation, stores all data currently in memory in a special file, then the PC turns off. When you then turn on your PC, that is, coming out of hibernation, hibernation files is used to restore the status of the PC than when you initially put into hibernation. In other words all the programs you had open before will automatically open and be ready to use hibernation.

    Hibernation or sleep for that matter is for short-term use. It is normal in Hibernate, or sleep if you want to be away from your PC for half an hour or so. If you leave more than I suggest you stop completely.

    A point to remember about hibernation is that, if you use put into hibernation, you can't, once you get out after hibernation, install programs or updates. You have to stop and restart normally to do.

    This forum post is my own opinion and does not necessarily reflect the opinion or the opinion of Microsoft, its employees or other MVPS.

    John Barnett MVP: Windows XP Expert associated with: Windows Expert - consumer: www.winuser.co.uk |  vistasupport.mvps.org | xphelpandsupport.mvps.org | www.silversurfer-Guide.com

  • "There is a time difference between the client and the server"

    Unit 4.0.3

    Everything worked very well, and all of a sudden, I'm not able to connect to the server unit using any domain account. When I enter the domain/name username/password, I get this error message:

    ************************************************

    The system is unable to log on due to the following error:

    There is a time difference between the client and the server.

    Try again or contact your system administrator.

    **************************************************

    I can use the same domain account (unityinstall) and the journal in other machines. I can connect the machine to the unit using a local account. There is no time difference between the DC server and unity.

    Need help,

    Thank you

    Partha

    Log on to your LOCAL computer using an account that has privileges

    At the command prompt, type the following:

    NET TIME ancien_mot_passe/set

    Found this on the MS site:

    Cannot open a session if the Date and time are not synchronized

    http://support.Microsoft.com/default.aspx?scid=kb;en-us;232386&product=Win2000

  • The difference between the strength of the signal and quality?

    Hi all

    According to the Cisco documentation

    Low RF signal strength does not mean the lack of communication.

    The quality of the signal is low means poor communications.

    If someone can explain to me the difference between the power of the signal and the quality of the signal?

    In accordance with my AP home I see that this signal strength is measured in numbers like 50% or 100%.

    But what is the quality of the signal and how to measure me?

    Thank you

    Mahesh

    Big question...

    First, let's look at the notion of signal quality and strength... Suppose for a minute you're front row at a rock concert right next to the speakers. Sound is loud, you can't hear anything else that scream. It is an example of a strong signal but poor quality.

    As for the signal and the noise of measurement or should we say quality of signal. Providers sometimes give you a % or dB scale when ranking signal. You can't really do headers or tails of the % scale because each vendor has % different measures. But check your access point, because you will be able to change in dB.

    Look at dBm. At the moment my client shows:

    Signal - 59 dBm

    Noise - 98 dBm

    The dB scale is simple. More PB the STRONGEST signal. You'll see - 59 of the signal is good, in fact, I'm about 50 feet from the AP. If you are under the ap you will get as a - 30ish. Noise, we do not want to be noisy, if we want to see the noise to-100. More low is the dB of noise as loud noise.

    So we're back out the example above. Next to the speaker, you're showing tell - 30dBm, but your noise can be as - 70dBm...

    Does make sense?

    Normally, you want to see your signal not exceeding 67 - not for voice or - 76 for the data. And your noise should be greater than-90.

Maybe you are looking for

  • Satellite L670 - 1 DG-can I use a 7200 RPM HARD drive?

    Hi all I have a portable Satellite L670 - 1 DG (out of warranty) and I would change the HARD 5400 RPM to 7200 RPM drive.It is technically possible on this machine? Is is necessary to use a Toshiba HDD (or open)? Thanks for your replies.Laurent

  • Windows xp 32-bit, 64-bit of need

    I've been using windows xp since I got it a few years ago, I loved, but now I have a pc 64-bit, with a 32-bit version of xp, how 64-bit, without having to go buy it all over again?

  • After effect SDK: updated layer mask

    HelloIs it possible to update the mask of the layer via SDK functions/suites?Best regardsYuri

  • Simply submit a region rather than a page

    Hi all Is it possible that would submit just one region rather than the entire page when I change a value of an element? I'm going to need to use dynamic actrions for that I guess? Thank you!

  • Space management and snapshot size

    Hi, guys.As I learned today deleting a snapshot can take fifteen or twenty minutes. From what I've read it can take much longer if he snapshot is extra-large.Here are my questions.When I have a virtual machine of the provisions, I could say that I am