Please help me to solve this problem of date comparison...

Please help me to solve this issue..

If i have some data like the following..


ID           START DATE             END DATE

1             20080101              20080501
1             20080502              20080630
2             20080631              20080801
2             20080802              20080901
                                             ---------------> There is a break in date over here
2             20080930              20081029
2             20081030              20081130


I need to compare the End Date with the start date (These data will not be in order)
and find out if there is any break and should get the 
release date: * 20080930 *.

I'm trying to do this in SQL or PL/SQL. Please help me.

Thanks in advance.
Phani

Hello

Try:

MHO%xe> select * from my_dates;

        ID STARTDATE           ENDDATE
---------- ------------------- -------------------
         1 01-01-2008 00:00:00 01-05-2008 00:00:00
         1 02-05-2008 00:00:00 30-06-2008 00:00:00
         2 30-06-2008 00:00:00 01-08-2008 00:00:00
         2 02-08-2008 00:00:00 01-09-2008 00:00:00
         2 30-09-2008 00:00:00 29-10-2008 00:00:00
         2 30-10-2008 00:00:00 30-11-2008 00:00:00

6 rijen zijn geselecteerd.

Verstreken: 00:00:00.14
MHO%xe> select startdate
  2  from  (select startdate
  3         ,      lag(enddate) over (partition by id order by startdate) - startdate lr
  4         from   my_dates)
  5  where  lr < -1;

STARTDATE
-------------------
30-09-2008 00:00:00

By the way: 20080631 is not a valid date, so I adjusted it to 20080630.

Tags: Database

Similar Questions

  • I would like to cancel a subscription to Premiere Pro program. I can't support Adobe in Russia, it does not work. Please, help me to solve this problem

    I would like to cancel a subscription to Premiere Pro program. I can't support Adobe in Russia, it does not work. Please, help me to solve this problem

    Hello

    Please refer to l https://helpx.adobe.com/creative-cloud/help/cancel-membership.html

    -or https://helpx.adobe.com/contact.html?step=ZNA_account-payment-orders_stillNeedHelp

    or

    Contact our support here Contact Customer Care

    You can follow the screenshot as below

    I hope this helps!

  • Please help me to solve this problem of CS5 - a poster the first time I'm user of long date

    While in the Middle, producing a large enough site, I get this error whenever I open a file in Dreamweaver CS5 and I can't view the file by using the button "Preview/debug in browser".

    Error:

    -By executing in_onOpen.htm onLoad, the following JavaScript error has occurred. In the file '_onOpen': it is not defined to onOpen-

    In addition, Dreamweaver let me not use/choose/Open the file. Browser preferences keep resetting.

    I went on the other forums and the points of the solution to the elimination of

    < user > / Library/Application Support/Adobe/Dreamweaver CS5/en_US/Configuration/MacFileCache-XXXXXXX.dat

    file is available, but I have no such file on my Mac OS X Version 10.7.3. I get as much as/Library/Application Support / Adobe.

    Actually I don't even see Dreamweaver on the list. (see attachment).

    libraryFile.gifThanks for all tips - Lauren

    This article should help: http://kb2.adobe.com/cps/405/kb405604.html

    Start by 12 and 4.  Those are most likely.  Then, if it does not sail on the rest.

  • Please help me to solve this problem of icon ;-)

    Hi people, I was wondering if someone can help out me?

    .

    I love the globe in example 1. I tried over and over again to recreate it but can't.

    I love the glow and all the gradients that make it look at how it works and it seems large and dark;

    Now, I have a load of icons as in example 2, I don't like all the world on it, it just doesn't show on my dark background. I need these bits internal icon, in this example, the pointer but have one handful of others also.

    So, how can I get rid of the inner bit of example 1, giving me a globe that retains all its transparency intact?

    Then cut the pointer off example2, change its color to a light gray and insert this in the Center or the new world?

    Other icons I have and you need to do this with are; Facebook, Twitter, a phone, an e-mail and a few others.

    The purpose of having a globe example1 empty I can then cut the icons and the place.

    Thanks a lot if you can help or ideas.

    Pete.

    example2.pngexample1.png

    OK, that makes a quick screenshot. Take a look by using files (press F1 on your keyboard) for more help with the pen tool and other pieces of fireworks. Welcome back to work - I'll try and answer anything else that you have if you don't find it in the help files

  • failure of the LCD... Please help how to solve this problem?

    Today, when I went from my laptop, a vertical rectangle in the meddle of my screen along top down (with less brightness of my screen background color).

    First I thought that it map graphic, but when I connect my laptop to my TV, the rectangle disappear, so it's right in the screen of my laptop.

    I tried to upload a screenshot turned to my office, but also the rectangle isn't here, so I see it only in my screen (average in the screen of my laptop). but I send a page to my office, and I used the paint program to give you an idea how my screen looks like

    but I couldn't uploaded here, you will enjoy if you can show me how to download

    Thank you

    It sounds like a hardware problem with your laptop, and there is probably nothing we can do to fix it here.  Have your phone checked by a reputable or approved repair facility.

  • fingerprint sensor does not work for my iphone 16 6 GB pls help how to solve this problem?

    I have iPhone 6 grey 16 GB of model space suddenly my fingerprint sensor no longer works.

    When I try to set touch id always displays "failed please go back and try again".

    Please guide how to solve this problem.

    The warranty expired 3 months ago

    See this support document to help solving the problems of contact ID. If all else fails, then make an appointment at the Genius Bar from the Apple Store supplier or Service Center authorized Apple closest to have the material examined. They will explain your options.  Use touch on iPhone and iPad - Apple Support ID

  • I face a problem in photoshop cc 2015. When I close a tab, then a pop - up massage a problem caused the program to stop working correctly. Please close the program. solve this problem

    I face a problem in photoshop cc 2015. When I close a tab, then a pop - up massage a problem caused the program to stop working correctly. Please close the program. solve this problem

    Try to uncheck 'use graphics processor' in preferences and restart Photoshop.

  • Update error that windowsupdate_8024402f failed to search for updates. Please help me to solve this error.

    Windows update is not running and comes up with this error. I tried Fix Windows and it did not help and I have tried a clean reboot and that didn't work either. I'm not particularly computer literate, but I can find my way if someone can give me clear guidance on how to solve this problem. It's been a few months now because an update worked so it becomes pretty serious! Help, please!

    Code error Windows Update 80244016, 8024402f, or c80003fa
    http://Windows.Microsoft.com/en-us/Windows7/Windows-Update-error-80244016-8024402f-or-c80003fa

    -2145107921 WU_E_PT_ECP_SUCCEEDED_WITH_ERRORS 0X8024402F

    You may encounter temporary connection related errors when you use Windows Update or Microsoft Update to install updates
    http://support.Microsoft.com/kb/836941

  • Please help me to solve this

    Hi I posted a question and its discussion in. I need help.
    Visit the folllwing wire and help me solve this problem.

    Re: Not able to put on the eve of the database

    Thanks in advance!
    Arun Kumar

    Published by: user8853422 on December 18, 2009 14:00

    user8853422 wrote:
    Hi I posted a question and its discussion in. I need help.
    Visit the folllwing wire and help me solve this problem.

    Re: Not able to put on the eve of the database

    Thanks in advance!
    Arun Kumar

    Published by: user8853422 on December 18, 2009 14:00

    And will help you to start another thread just allude to the first?

  • My front camera not working after update to ios 9 (Iphone 5) Please help me to solve this

    Hello

    My front camera of the iphone 5 does not work after update to ios 9, please help?

    I have the same problem on my 5s.  Just after the upgrade to 9.3 camera is black.

    Work, rear camera, but the camera application usually freezes before let me pass.  Sometimes a warning icon yellow appear in enforcement camera, touch, he says the flash does not work for the unit to cool down.  No change after a restore is complete.  Other applications of the camera have the same problem.

    iPhone 5, iOs 9.3

  • Got the following error please suggest ways to solve this problem, thank you.

    I have Windows vista home basic version and received the following error message. Not able to install new programs so lately. Apart from that if I right click and try try to customize it would not allow me to... file opens and closes by itself!

    Product Windows® installation problem stopped working

    Problem event name: BEX application
    Fault Module name: MsiHnd.dll
    Fault Module Version: 4.0.6001.18000

    Hi RamakrishnanS_1080,

    ·         Have you made changes on the computer before this problem?

    I suggest you follow these methods.

    Method 1: Follow the steps in the article.

    How to troubleshoot issues that may occur when you install, uninstall, or upgrade one program on a Windows computer

    http://support.Microsoft.com/kb/2438651

    Method 2: To the question to customize, follow the steps:

    Step 1: Start the computer in safe mode and check if the problem persists.

    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode

    Step 2: If the problem does not persist in safe mode, perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After the boot minimum troubleshooting step, follow step 7 in the link to return the computer to a Normal startupmode.

  • Please help me to test this problem with CSR4 and Flash10.

    I tried the below problem on systems of 2 2 portable Windows desktop and with the same result. Please test this procedure and report if you do or do not have the same results.

    I guess that the systems you use are later with all updates installed.

    1. start Photoshop and open any image file. Click on the move tool and see that you get the normal tool cursor.

    2. navigate to http://www.layersmagazine.com/working-with-text-in-flash-part-2.html (uses Flash 10 as the engine tutorial).

    3. the tutorial should start automatically. While it runs switch to Photoshop and make sure that you always have a moving cursor.

    4 switch the tutorial and click on the flash icon to watch full-screen mode. Watch it for a few seconds. Press ESC to return to the normal size.

    5 go to Photoshop and look at the cursor. On 4 systems I tested on, the cursor turns into a hand and remains a helping hand any tool icon is clicked.

    Sometimes the tutorial and closing Photoshop returns all this normal functioning. I reported this service the customer. Sometimes I have to reboot for it to happen.

    I want to determine if it's just that I've tested 4 systems or if others are experiencing the same problem. Thank you for your help.

    Mike

    If you hand your space bar icon is stuck.  He tap several times and blow crumbs.

  • Impossible to delete the virtual machine that is stuck at 95%, can you all help me to solve this problem.

    delete.jpg

    Thanks for the help guyz, I restarted the virtual service centre and the problem was solved.

  • Please help me to solve the problem of the icloud blocking...

    Hello

    My girlfriend can't activate the iphone locked 5 as she forgot her password to icloud and also answers to secret questions... She just remembers his apple ID, birth date, and access to the e-mail of recovery she provided creating his Apple ID... Is it possible to recover her icloud password or unlock his account icloud with these data?

    Go to https://getsupport.apple.com . Click on "see all of the products and services ', then 'More', then 'Apple ID', then 'other Apple ID subjects' then 'security issues forgotten Apple ID". If you have problems with this test of this form: https://www.apple.com/emea/support/itunes/contact.html

  • I get the error indicating the niajel.dll missing for HSDIO in labVIEW 2010, can someone help how to solve this problem.

    I'm using LabVIEW 2010 and installed the drivers from device LV2010 and try to use the HSDIO functions, while setting the HSDIO function on the block diagram showing niajel.dll is missing, can someone help me fix this bug.

    I tried to uninstall and install not able to set several times.

    Hello. niajel.dll corresponds to the NOR-TClk, although NEITHER-HSDIO does not specifically use it. You use certain functions TClk?

    Also, what other PXI device driver are installed on the system? Could you give a report on the MAX system?

Maybe you are looking for

  • HP-15r250tu: can I put my card graphics and ram?

    I currently have intel graphics hd... that is not my brand! and want to upgrade to ddr3l 4 GB to 8 GB sdram... so please help me with this details... and if iam eligible... thnak u... new .am on HP.

  • P7 - 1446 s: limited access - unable to load web pages

    Even though I am connected to the internet, web pages does not load. Fault-finding, he said: I have "limited access" (I tried the rigid cable and the woman - same deal, no go). Thought it could be my ISP, I was on the phone with support from AT & T a

  • Parameters

    New user of TestStand 4... This question is related to the parameters displayed in the pane 'specify Module... the parameter values are not always displayed in the pane even if they are present in the sequence? TestStand frequently displays the error

  • his order after you have installed the hp dc7900 low profile video card

    I installed a hpcompaq dc7100 low-profile video card. Since then the sound has stopped working. anyway to uninstall the audio portion of the video card and use the original computer sound card? or any other suggestions to have the computer see the ne

  • why I can't download international QQ on Windows xp

    I'm trying to down load a QQ international social program since its Web site. Whenever I load it shows the configuration problem. . any body can help me what goes wrong. Shahid