Eliminate rows in a windows of x seconds

Hi,
Please consider the following case:
I have a table with millions of rows.
I need to eliminate from the statement results each set of rows (two or more) , which exists in a window of 60 second.
For example:
create table test
(id number,
b date);
insert into test values(1,to_date('01/01/2012 16:00:10','dd/mm/yyyy hh24:mi:ss'));
insert into test values(2,to_date('01/01/2012 16:00:20','dd/mm/yyyy hh24:mi:ss'));
insert into test values(3,to_date('01/01/2012 16:03:10','dd/mm/yyyy hh24:mi:ss'));
insert into test values(4,to_date('01/01/2012 16:45:50','dd/mm/yyyy hh24:mi:ss'));
insert into test values(5,to_date('01/01/2012 16:46:20','dd/mm/yyyy hh24:mi:ss'));
insert into test values(6,to_date('01/01/2012 18:59:50','dd/mm/yyyy hh24:mi:ss'));
commit;
select id , to_char(b, '/dd/mm/yyyy hh24:mi:ss') from test;
SQL> select id , to_char(b, '/dd/mm/yyyy hh24:mi:ss') from test;
        ID TO_CHAR(B,'/DD/MM/YY
         1 /01/01/2012 16:00:10
         2 /01/01/2012 16:00:20
         3 /01/01/2012 16:03:10
         4 /01/01/2012 16:45:50
         5 /01/01/2012 16:46:20
         6 /01/01/2012 18:59:50 -- Based on the logic above only id : 3 and 6 should be return from the statments.
I succeeded to eliminate the rows which are in the very same minute (id 1 +2 ) but not in a windows of 60 seconds
such as id 4+5 .
Please advice

Like this?
SQL> ed
Wrote file afiedt.buf
  1  select id, b
  2  from (
  3        select id, b
  4              ,case when abs(b-lag(b) over (order by b)) < (1/(24*60))
  5                      or abs(b-lead(b) over (order by b)) < (1/(24*60))
  6               then 0
  7               else 1
  8               end as chk
  9        from test
10       )
11* where chk = 1
SQL> /
        ID B
         3 01-JAN-2012 16:03:10
         6 01-JAN-2012 18:59:50Edited by: BluShadow on 07-Jun-2012 14:08
ps. you may want to have the condition as "<=" rather than "<" depending on what you mean by "in" the window of 60 seconds.

Similar Messages

  • How to print main window data in second page without header

    hi friends.,,,,,,,,,,,,,,,,,,,,
    I am printing billing docu details in main window ,the data is coming in two pages but there is problem in printing as the tables is continuing in second page the line is not coming for the table for first row,space is also coming for second page for header .
    my issue is to remove space before printing table and line should come for the table for 1st row in second page.
    please help .
    thanks in  advance.

    Hi Raghukumar,
    1. For the line not coming on the top row of the second page, check if the rowtype u have used in the table has been given a border on the upper side.
    2.For the space issue in the second page, I assume you might have used only a single Page in your smartform and the same page is called again.Hence as per the main window size and length data will be displayed in all pages of the smartform.
    You may need to create a second page with the Main window length occupying the compete page so that data display starts from the top of the page. next Page attributes of the smartforms should be entered accordingly.
    Please try to elaborate your query to help us understand your issue.
    Regards,
    Rijuraj

  • How can I start a second window of a second profile through the command line?

    I have two profiles set up, 'default' and 'second'. If both are already running how can I start a second window of profile 'second'?
    firefox -p 'second' : opens a new window of the default and,
    firefox -p 'second' -no-remote : tells me that firefox is already running.

    I don't think that this is possible.<br />
    You need to open this second instance (Firefox profile folder) with the -no-remote command line switch and that makes it impossible to open external links via the command line or via a double-click.<br />
    You can only open a link in such an instance by dragging the link on the tab bar of that Firefox window.

  • Creative Cloud both on Mac and Windows on a second computer

    Is it possible to use Creative Cloud both on Mac and Windows on a second computer with one license? At home I work with Mac, and out I work with Windows.

    In 2.1.5 of the Software License Agreement it says that you have to own tow separate licenses if you use Mac and Windows on one computer. Is this not also the case if you have two computers, one operating with Mac and one operating with Windows?
    2.1.5 Dual Boot Platform. The Software is licensed for use on a specific operating system platform. Customer
    must purchase a separate license for use of the Software on each operating system platform. By way of example,
    if Customer desires to install the Software on both the Mac OS and Windows operating system platforms on a
    device that runs both of those platforms (i.e., a dual boot machine), then Customer must first obtain two separate
    licenses for the Software. This is true even if two versions of the Software, each designed for a different operating
    system platform, are delivered to Customer on the same media.

  • Can I recover Windows 8 as second OS in dual boot?

    OK, here was the plan:
    I plan to dual boot IdeaPad Z500 by adding Windows 7 on top of Pre-Installed Win8.
    But seems like it's impossible to do so since I can't get the Win 7 Installer to start on UEFI mode, and I can't install Win 7 into GPT drive in Legacy Mode.
    So now I'm looking into another option of changing the whole HD into MBR Partition to enable it to be booted with Legacy mode, which basically will wipe my Win8 out of existence. Then install Win7 using Legacy mode on it, and then make Win8 as the second OS after I partition the HD.
    Now here's the question before I start: I've already made a USB recovery drive of Win8. If I install Win7 first, can I install Win8 using the recovery drive into the partition of my choosing? Or will it just install itself on top of and deleting my Win7 installation?
    If I can do that, can I recover Win8 into an MBR partition? Or is it just not possible?
    Solved!
    Go to Solution.

    Ah... That's too bad.
    Just for clarification, the recovery thumb drive I meant was from thumb drive I created from Windows Recovery (Control Panel -> Action Center). Not from Lenovo OKR.
    I understand that OKR most certainly can't recover as second OS. So you mean to say that Windows Recovery will also not be able to do so? Since you say it as Lenovo Recovery Media, I'm not sure whether it's the same as OKR or Windows Recovery.
    Secondly, will installing Windows 7 revoke my warranty? If it doesn't: Is it possible for me to get information on my current license of Windows 8 (S/N) that my Z500 provided? Can I use that license to install Windows 8 back as second OS? Or do I have to purchase a new license of Windows 8 for that purpose?
    I would really love to keep Windows 8 as main OS and Windows 7 as my second OS, but seems like since Z500 BIOS have no switch to enable CSM mode while still boot in UEFI, I can't install Windows 7 as second OS at all. Perhaps Z500 BIOS would need some upgrade to have that switch embedded in, seeing as several other Lenovo product have it. So the only other option I have is to switch it the other way around, Windows 7 as main OS and Windows 8 as second OS. So I wanted to know if I can use my current license of Win8 for that.
    Thank you so much for your reply.

  • How do I set Firefox to open new windows in my second monitor?

    When opening a new window (by right clicking a link and selecting Open in New Window), I would like the window to be opened in my second monitor. Firefox used to do this, but randomly stopped. Now when I open a new window it is opened in my primary monitor. It does not open maximized (just short of being completely maximized). I have tried the fix I used before- moving the un-maximized browser to the second window, closing and re-opening the window. I have also tried moving the un-maximized browser, maximizing, closing and re-opening. Does anyone know how I can restore Firefox to open my new window in the second monitor?
    == This happened ==
    Every time Firefox opened
    == Randomly

    Click the orange Firefox button, and click "Options". This will bring up a new window with a "Tabs" tab at the top. Click that. There will be several checked boxes, including one called "Open new windows in a new tab instead" up at the top of the list. Uncheck that box and you should be good to go.
    ETA: This should also work if you click "Tools" and "Options" within your version.

  • HT3986 can i put windows on a second hard drive that is partitioned.

    can i put windows on a second hard drive that is partitioned with out boot.camp deleting the second partition and making one bootcamp windows partition?
    i want one partition to be OS extended journaled and one partition for windows. Or do I have to create the bootcamp partition on my main drive? . my main drive is a solid-state drive which I run OS X and it's not as big as my mechanical drive. I would like to put windows on my mechanical drive but still save a lot of the drive for my mac data. So I would like to have that drive partitioned with OS extended journaled. Whenever I run boot camp and choose that hard drive boot camp will only allow me to erase the whole hard drive and make one partition for Windows. Maybe if I put OS X also on the mechanical drive and then try? Would that work. Thank you for any information you might have. Robert

    Yes! why not.Just make sure after you install windows,linux,freebsd or any other os set to use mbr if there is a gpt partition first ALWAYS gptsync.

  • I work on two screens. With the new updates, my computer will not automatically open a new window on the second screen.

    I work on two screens. With the new updates we cannot automatically open a new window on the second screen, but have to move them over manually. Not a huge problem, but because of the nature of the work, it gets tedious.

    Hi Annowriter,
    Thank you for your question, I understand that it is annoying to have to move a new window to the second screen. Since it opens in the active screen this may have been a stored preference, however it is not the default.
    There is an add on called [https://addons.mozilla.org/en-US/firefox/addon/monitor-master/ Monitor Master] that customizes settings like this. Check it out.

  • Triggering main window of the second page

    Hi Experts,
    I have two pages. Second Page will only get trigger at certain condition. I am triggering the Second page through Command. My issue is my second Page is triggering but the main window of the second page is not getting triggered. It should be like that the main window should get triggered. Even I have copied the main window and used it in the second page that is also not getting triggered. Please help me to resolve this issue.
    With Regards,
    Anomitro

    Hi,
    You should not create a new main window in the Second page of the smartform
    Instead, you copy the main window of the first page to the second page.
    So even if you add a text window in the first page Main window that will be reflected in the second page, but this should be below the command window.
    Use the command window to trigger the second page.It triggers the second page and all the text windows that are after(under) the command window will be coming in a new page.
    Check this link: https://wiki.sdn.sap.com/wiki/x/bAZqBg
    Hope this helps
    Thanks
    Sarves S V K
    Edited by: Sarves Sombhatla on Feb 21, 2011 6:56 PM

  • Can I set the time ruler in the main window to minutes/seconds/milliseconds?

    Is there a way to set the time ruler in the MAIN window to minutes/seconds/milliseconds?
    It seems that the only ruler time display option is minutes/seconds/frames/subframes.
    Or, failing that, is there a way to suppress the display of frames/subframes?
    I have already figured out how to set the main ruler to time, and the LCD to minutes/seconds/milliseconds…it's just a matter of having that in the ruler as well.
    Thanks.

    To my surprise that is not possible. Although, surprise...
    You could put in a feature request here:
    http://www.apple.com/feedback/logic-pro.html
    and/or here:
    http://www.logicprohelp.com/forum/viewforum.php?f=41

  • Firefox 4 stops opening new windows after browser window dragged to second display

    Firefox 4 stops opening new windows after browser window dragged to second display. It's weird. Behavior is fine until I drag any browser window to the attached second display, and after this point it stops opening new windows but will still open new tabs in the same window. Restart fixes it until I drag the window back to the second display.
    "Show all bookmarks" stops working too--won't open a new window.
    This is after clean reinstall with total deletion of any Firefox/Mozilla folders and the previously installed app and a restart of the computer.
    Mac OS X 10.6.7
    Firefox 4

    Pretty sure this is either:
    '''Bug 644733'''
    or
    '''Bug 609405'''
    (...and they may be reporting the same thing.)

  • SAP MI 2.5 (+CrEme) doesn't work under Windows Mobile 2003 Second Editon

    While testing our new Hardware (Dell Axim X30 with Intel PXA270-CPU and Windows Mobile 2003 Second Edition (4.21.1088)) i noticed, that the SAP MI Client Software will not work at all!
    <i>Setup says "The program you have installed may not display properly because it was designed for a previous version of Windows Mobile software."
    But this doesn't seam to be the Problem, because whenever you install an application that hasn't been updated to be compatible with the Second Edition, this dialogue box pops ups.</i> (Reason: The new Landscape-Mode - Our device runs in Portrait-Mode)
    ...Ok, after tabbing "OK" at this Dialogue, Setup continues! Same procedure at the CrEme-Installer!
    After Soft-Resetting, the PocketPC shows up the Message that CrEme is starting up, but it doesn't listen it's Port on the PDA!
    You get a Timeout when trying to load the MobileInfrastructure via the Link at Startmenu.
    Also the InternetExplorer crashes when opening a webpage with an Java-Applet. Don't know if IE crashes on Windows Mobile 2003 First Edtion, but i don't think so...
    <i>Of course the SAP MI 2.5 works on the First Edition!</i>
    Anyone knows this problem <b>and when can we expect a Solution?</b>

    Hi all!
    I found out that CrEme crashes after executing on Windows Mobile 2003 2nd Edition!
    Just start the CrEme-Console ("\Windows\CrEme\bin") and type "java" into the Console, it crashes immediately after printing some Messages.
    The window disappears too fast to guess what it says...
    BTW: On PocketPC 2003 (1st Edition) it doesn't crash!
    So it seams we need a new CrEme (or other VM??) for Windows Mobile 2003 2nd Edition!
    Any ideas?
    Thanks in Advance,
    Markus

  • Photoshop CS6 doesn't remember window location on second monitor

    Hey
    I have 2 monitors and I've arranged the panels on one screen and the main ps windows on the second.
    I saved it as a new workspace, but now, after I restart photoshop, all the panels and the main window goes back to one monitor.
    I've arranged it like this:
    but after I close and reopen photoshop, it looks like this:
    How can I make photoshop remember the window's location after restart?
    Photoshop CS6 13.0.1 x64
    Windows 8

    Nah, I just stayed at a Holiday Inn Express last night. 
    You're welcome - glad I could help.
    -Noel

  • Whenever I try to open a PDF, the window closes 5 seconds later.

    Reader is malfunctioning on my computer. Whenever I try to open a PDF, the window closes 5 seconds later. This all started a few days ago when I tried updating the version of Reader I had. Since then I've had multiple problems or either not being able to open PDFs with any time of security on them, and now after I use the adobe cleaner and downloaded the whole program new, nothing opens. I tried this with XI (which is what I originally had the problems with), then X, and now I have 9.5 Same problem with all of them
    PLEASE HELP!!  I need to be able to view PDFs and digitally sign them for work!

    Somethings to try...
    Using Windows Explorer navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement
    Can you open Adobe Reader by itself?  If so, try disabling Protected Mode [Edit | Preferences | Security (Enhanced)].
    It could even be a malware issue; see http://helpx.adobe.com/acrobat/kb/reader-core-dll-error.html

  • Visual Studio 2013 Publish window takes 30 seconds to load

    The Publish window takes 30 seconds to load in my ASP.NET MVC5 project. Previously, it loaded instantaneously.
    If i remove the PublishProfiles folder, the window loads at once. Its only after i've saved an actual publish profile this occurs.
    A new empty project does not have this problem. Therefor the problem 'should' be related to the solution/project.
    Some more information:
    Visual Studio 2013, fully updated.
    ASP.NET Web Application
    .NET Framework 4.5.1
    MVC 5
    Any ideas how to proceed ? :-)

    Hi Antevirus,
    Do you install the VS2013 update 4?
    If you publish the same app in other vs machine, how about the result?
    To make sure that it is not your VS IDE issue, please also run it in safe mode, or reset your VS settings.
    For the performance issue, please also think about the windows Environment like configurations or other processes.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • ALV GRID Problem with reading contents

    Hi there! I'm quite new with ABAP and I have some problems with the syntax of it. Maybe I should first describe my aim and then I'll show you my code. 1. I read contents from two database tables, called 'zbc_dan_registry' and 'zbc_dan_category'. 'zbc

  • How creating a llb that will contain all subvis of an upper vi?

    Hi, I developed an application under 6.1, which is composed of subvis coming from several developments, stored in various places on my PC... In order to distribute it, I was wondering if it was possible, from the upper vi, to create a llb (or a distr

  • Select all tick boxes

    I have a cfoutput query which shows the folowoing Group 1 "Check box" "John Smith" "Check box" "Paul John" "Check box" "Jeff Small" Group 2 "Check box" "Craig Land" "Check box" "Pete Son" "Check box" "Pete smoth" so what i want next to each "Group" h

  • To automate assigning employee to respective position.

    Hi All, Anyone knows about how to assign Employee(Business Partner) to the respective position for the organizational unit programmatically. three tasks:- To Automate the following programatically:- 1. assign employee to the position. 2. update emplo

  • InfoCube 0PM_C04 is not available

    Hi All, I am trying to install 0PM & 0QM business content & when I try to install 0PM_C04 it gives a mesage that "InfoCube 0PM_C04 is not available". We are on BI 7.0, BI_CONT 703. Any idea/comment on what could be the reason? PK