process the renewal - only show the last dealid

Hi all

my need is to exclude the double for the renewal of the agreement. During the renewed agreement the double amount in report. It happens because the same sum temporarily of shows for the two dealid.

How it should be:

If
-accountno is the same
-currencyid is the same
-symbolic sum is the same
-date of end (1) = date start (2)
-dealid (1) and (2) are different
then
-show only the last dealid
on the other
-show the two

So the 12345 dealid should not appear in the example below:
select 111 as accountno, 840 as currencyid, 100 as nominal, date '2012-01-01' as datebegin, date '2012-10-20' as dateend, 12345 as dealid from dual
union all 
select 111 as accountno, 840 as currencyid, 100 as nominal, date '2012-10-20' as datebegin, date '2012-12-20' as dateend, 12346 as dealid from dual
union all 
select 222 as accountno, 978 as currencyid, 101 as nominal, date '2012-02-20' as datebegin, date '2012-10-20' as dateend, 12347 as dealid from dual
union all 
select 222 as accountno, 978 as currencyid, 102 as nominal, date '2012-02-21' as datebegin, date '2012-12-18' as dateend, 12348 as dealid from dual
How can I make it?

Hello

Here's another way:

SELECT     *     -- or whatever columns you want
FROM     table_x  e
WHERE     NOT EXISTS (
                     SELECT  0
                 FROM    table_x  l
                 WHERE   e.accountno     = l.accountno
                         AND     e.currencyid     = l.currencyid
                 AND     e.nominal     = l.nominal
                 AND     e.dateend          = l.datebegin
                 AND     e.dealid        != l.dealid
             )
;

This makes fewer assumptions than the Kim on the dates being unique, in order or which overlap.

Tags: Database

Similar Questions

  • a table of images only the last image shows the index

    Hello world

    I try to index a table of images and all, but the last item gives me the error: "not an image."

    Here is a picture of the vi. The first loop load images and stores them in an indexed auto tunnel. Each diagnosis that I fell on this loop showed that all is well. The second loop must display the image stored in the tunnel sequence indexed auto, but it does not work. Instead, I got the error message that the 0 to n - 1 elements are not images, and only the last image is displayed.

    What I am doing wrong?

    Thanks for your help.

    and vi:

    Hello

    This VI has worked well for me with a contribution of 5 bmp files. You can check your input files?

  • Would be nice to the tabs of the BURDEN of the last time, not only to show them. Just a suggestion.

    After using the Chrome in the past, I found useful to have the tabs for the last time in charge, not only displayed. In Firefox, tabs are displayed only, and there is no option for have loaded them automatically. This isn't a question (unless there's something I don't know that would allow me to do so), but a suggestion to improve in the future.

    'Don't load it the tabs until you choose' setting has been removed in Firefox 47 + to avoid performance problems with restore all tabs automatically especially where the multi-process tabs is enabled.

    You can change the related preferences on the topic: config page in current versions, if you are willing to accept the problems of performance possible.

    • Browser.sessionstore.restore_on_demand (true)
    • Browser.sessionstore.restore_pinned_tabs_on_demand (false)
  • Menu Spry missing first submenus, but showing only the last.

    Hello, I'm doing a site for a school project and I have a spry menu code that looks good, but when it is turned on, when you move the menu, submenus are empty except for the last.

    Here's what it looks like on a mode live view:

    SPry Menu.png

    Above war-torn project are three submenus. They have the text, but will not appear. My other menus do the same thing. For personal reasons, I will not not to publish the entire site because of his real name, address, contact, etc.

    I'll post the menu spry and css menu spry.

    Spry menu:

    < div class = "container" >

    < div class = "NavigationBar" >

    < ul id = "MenuBar1" class = "MenuBarHorizontal" >

    < li > < a href = "#" > about me < /a > < /li >

    < li > < a href = "#" > Contact < /a > < /li >

    < li > < a class = "MenuBarItemSubmenu" href = "#" > < /a > ongoing projects

    < ul >

    < li > < a class = "MenuBarItemSubmenu" href = "Film.html" > < /a > Film

    < ul >

    < li > < a href = "#" > fictions < /a > < /li >

    < li > < a href = "#" > Japan 2016 < /a > < /li >

    < /ul >

    < /li >

    < li > < a href = "Photography.html" > photography < /a > < /li > ""

    < li > < a href = "Story.html" > stories < /a > < /li > ""

    < li > < a href = "Project_Wartorn.html" > project: torn apart by the war < /a > < /li > ""

    < /ul >

    < /li >

    < li > < a href = "#" > equipment < /a > < /li >

    < /ul > < hr / >

    <! - end .header - > < / div >

    < div class = "content" >

    Spry CSS menu:

    @charset "UTF-8";

    / * Sections - version 0.6 - Pre - Release Spry 1.6.1 * /.

    / * Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */

    /*******************************************************************************

    The AVAILABLE INFORMATION: Describes the box model, positioning, the order

    *******************************************************************************/

    / * The outermost container for the menu bar, an area of width auto without margin or padding * /.

    UL. MenuBarHorizontal

    {

    padding: 0;

    list-style-type: none;

    font size: 20px;

    cursor: default;

    Width: 921px;

    height: 30px;

    background-color: #333;

    do-family: "Arial Black", Gadget, without serif.

    text-align: center;

    margin-top: 0;

    right margin: 15px;

    margin-bottom: 0;

    margin left: 19px;

    }

    / * Value of the menu bar active with this class, currently the definition of z-index to accommodate IE rendering bugs: http://therealcrisp.xs4all.nl/Meuk/IE-zindexbug.html */

    UL. MenuBarActive

    {

    z-index: 1000;

    }

    / * Menu item containers, position of children relative to this container and are a fixed width * /.

    UL. MenuBarHorizontal li

    {

    padding: 0;

    list-style-type: none;

    do-size: 100%;

    position: relative;

    text-align: left;

    cursor: pointer;

    Width: 230px;

    float: left;

    height: 15px;

    margin: 0;

    }

    / * Submenus should appear under their parent (top: 0) with a higher z-index, but they are first the left side of the screen (-1000em) * /.

    UL. MenuBarHorizontal ul

    {

    margin: 0;

    padding: 0;

    list-style-type: none;

    do-size: 100%;

    z index: 1020;

    cursor: default;

    Width: 8.2em;

    position: absolute;

    left:-1000em;

    }

    / * Submenu that shows with the designation of the class MenuBarSubmenuVisible, we put the car left so it happens on the screen below its parent menu item * /.

    UL. MenuBarHorizontal ul. MenuBarSubmenuVisible

    {

    left: auto;

    }

    / * Container of menu items are same fixed width parent * /.

    UL. MenuBarHorizontal ul li

    {

    Width: 8.2em;

    }

    / * Submenus should appear slightly overlapping to the right (95%) and upward (-5%) * /.

    UL. MenuBarHorizontal ul ul

    {

    position: absolute;

    margin:-5% 0 0 95%;

    }

    / * Submenu that shows with the designation of the class MenuBarSubmenuVisible, we have left to 0, it is on the screen * /.

    UL. MenuBarHorizontal ul. MenuBarSubmenuVisible ul. MenuBarSubmenuVisible

    {

    left: auto;

    top: 0;

    }

    /*******************************************************************************

    INFORMATION DESIGN: Describes the set of colors, borders, fonts

    *******************************************************************************/

    / * Submenu containers have borders on all sides * /.

    UL. MenuBarHorizontal ul

    {

    border: 1px solid #CCC;

    }

    / * Menu items are a light grey block with padding and no text decoration * /.

    UL. MenuBarHorizontal a

    {

    display: block;

    cursor: pointer;

    background-color: #333;

    color: #393;

    text-decoration: none;

    Width: auto;

    padding-top: 0.5em;

    padding-right: 0.75em;

    padding-bottom: 0.5em;

    padding-left: 0.75em;

    }

    / Components menu that have mouse over or focus have a blue background and white text * /.

    UL. MenuBarHorizontal a: hover, ul. MenuBarHorizontal a: focus

    {

    background-color: # 33;

    Color: #333;

    }

    / * Menu items that are opened with the submenus are on MenuBarItemHover with a blue background and white text * /.

    UL. MenuBarHorizontal a.MenuBarItemHover, ul. MenuBarHorizontal a.MenuBarItemSubmenuHover, ul. MenuBarHorizontal a.MenuBarSubmenuVisible

    {

    background-color: #F0F0F0;

    Color: #333;

    Width: auto;

    }

    /*******************************************************************************

    Submenu INDICATION: styles if there is a submenu in a given category

    *******************************************************************************/

    / * Menu items that have a submenu have the MenuBarItemSubmenu class designation and are set to use a positioned background the far left (95%) and vertically centered image (50%) * /.

    UL. MenuBarHorizontal a.MenuBarItemSubmenu

    {

    background-image: url (SpryMenuBarDown.gif);

    background-repeat: no-repeat;

    background-position: 50 95%;

    }

    / * Menu items that have a submenu have the MenuBarItemSubmenu class designation and are set to use a positioned background the far left (95%) and vertically centered image (50%) * /.

    UL. MenuBarHorizontal ul a.MenuBarItemSubmenu

    {

    background-image: url (SpryMenuBarRight.gif);

    background-repeat: no-repeat;

    background-position: 50 95%;

    }

    / * Menu items that are opened with the submenus have the designation of the MenuBarItemSubmenuHover class and are set to use a background image "hover" positioned on the far left (95%) and centered vertically (50%) * /.

    UL. MenuBarHorizontal a.MenuBarItemSubmenuHover

    {

    background-image: url (SpryMenuBarDownHover.gif);

    background-repeat: no-repeat;

    background-position: 50 95%;

    }

    / * Menu items that are opened with the submenus have the designation of the MenuBarItemSubmenuHover class and are set to use a background image "hover" positioned on the far left (95%) and centered vertically (50%) * /.

    UL. MenuBarHorizontal ul a.MenuBarItemSubmenuHover

    {

    background-image: url (SpryMenuBarRightHover.gif);

    background-repeat: no-repeat;

    background-position: 50 95%;

    }

    /*******************************************************************************

    BROWSER HACKS: hacks below should not be changed, unless you are an expert

    *******************************************************************************/

    / * HACK FOR IE: to ensure that sub menus show above form controls, underpin us each submenu with an iframe * /.

    UL. MenuBarHorizontal iframe

    {

    position: absolute;

    z index: 1010;

    Filter:alpha(opacity:0.1);

    }

    / * HACK FOR IE: to stabilize the appearance of the menu items. the slash in the float is to keep IE 5.0 analysis * /.

    @media screen, projection

    {

    UL. MenuBarHorizontal li. MenuBarItemIE

    {

    display: inline;

    f\loat: left;

    background-color: #333;

    }

    }

    I guess you have your SpryAssets responsible, including the javascript file concerning it. Also, check the bottom of your swap file for the javascript code specific to this menu bar. Spry menus come with three components, the call to the head of the document for the javascript files and css, the structure itself in the body of the document and javascript code at the bottom of the body (before the tag).

    Javascript is not published (and not for the faint of heart); the css controls the menu bar similar to and can be edited with care, and this at the bottom of the page (for example), defining the new variable in the menu bar:

  • Why adobe reader plugin shows as not being updated, even when it's the last version

    Hello
    I have the latest adobe reader. When I check the plugins from firefox, it says that it needs to be updated. But once installed, it closes as showing that the last adobe drive is already in use, and the only thing I can do is to get out this message with the button FINISH. Now, if it is still activated, the firefox plugin shows is not up-to-date. Some of these photos on the web page are not correctly captured. How to get rid of this problem. Is this a problem with FF or AR

    edited to remove the spaces to the left causing a horizontal scroll bar to appear in the details

    Hi jraju, that's exactly right: the plugin check Web site is currently wrong. If your product Adobe says that it is up to date, it is the most accurate information at the moment.

  • Why the tabs have now several images showing after the last updated favicon?

    The last update for Firefox has created a problem with the tabs. The tabs now have multiple images of the websites favicon projection. When I open a tab and visit a Web site, when the favicon shows then it creates multiple images of this favicon. When I click the tab and then back on it, they disappear, but obviously, this should not happen and did not begin until the last update has been installed. I even did an update and it does not solve the problem. I tried to upload an image, but the region has just a spinning wheel and the size of the image was only 5,41 kb. Apparently that doesn't work so well either. It seems that Mozilla Firefox has created a few bugs for its browser and help forum.

    If anyone knows how to fix this or get Mozilla to solve their problem, it would be appreciated. Thank you!

    You can try to disable hardware acceleration in Firefox.

    • Tools > Options > advanced > General > Browsing: "use hardware acceleration when available.

    You will need to close and restart Firefox after enabling/disabling this setting.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.

    • Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe
  • Firefox history only remembers the last time a certain web address is visited.

    For example, I visited www.example.com Monday, Tuesday and Wednesday. 3 all-time, Firefox only remembers the visit Wednesday. Because when I visited www.example.com Tuesday, history repeats, deleting record on Monday; When I visit www.example.com Wednesday, account of evaporated Tuesday.

    So no matter how many times I visit a web address, Firefox only remembers the last time. Is it possible to tweak Firefox to faithfully make history?

    I'm not native English speakers. I hope that my bad English clearly describe the issue.

    Thanks in advance for your answers.

    Firefox stores all the time you visit a web page to be able to calculate the number of visit, but shows only the last time that you visited this link.

    For example, see this thread:

  • 'Go Back' arrow shows more than the last page visited?

    Simply upgrade to V4.0 formerly the 'back' arrow showed on the last 10 pages visited. So if I was on a forum page 7 and wanted to return to page 1 I could do this very easily with one click. This version is only allowing me to go back one page at a time. I'm doing something wrong or Firefox goof?

    Right click on the "back" button arrow.

  • Can I make composer show on iTunes.  It only shows the artist and I want to show composer.

    I wish my iPhone to show the composer on iTunes during the playback of a file.  It shows only the name and the album and artist.  For classical music, it is not enough.  Composer is very important.  Y at - it a display menu for what you want to see everything as there is on the version of iTunes regular pc?

    Do you mean the music app on your phone? It is not referred to as iTunes on the phone.

    The last music player is very minimal.  Artist and title seems to be it.

    Apple let know here > > > http://www.apple.com/feedback/iphone.html

  • I have more than music in itunes my ipod can hold, the last time I synced, there was a box to synchronize playlists only, now it's over so how can I now sync playlists only, you can see?

    I have more than music in itunes my ipod can hold, the last time I synced, there was a box to synchronize playlists only, now it's over so how can I now sync playlists only, you can see?

    Select the iPod in iTunes (click on its button on the device on the horizontal bar) to show its settings screen in the iTunes window.  The side left (in the sidebar), under settings, click music.  To the right, the settings screen of music from iPod, where you tell iTunes how to sync songs to the iPod.

    NOTE: All of the songs on the iPod that are not in your iTunes library (on the computer) will be lost.

    Check the box to Sync music (if it isn't already).  Below, choose the option synchronize playlists, artists, albums, and genres.  Below, under playlists, select (check) the playlists you want on the iPod.  You can also select other articles on other lists, as you wish.  Click Apply to sync your selection to iPod.

    Further, iTunes automatically updated the iPod with the changes made to the selected part of the iTunes music library.  For example, if you update a list of selected reading (add/remove songs), updates iTunes, the iPod with the same changes the next time you connect (or click Sync if already connected).

  • How can I stop the last post showing when I want to send this person a new Imessage.  I have an Iphone 5s

    How can I stop the last post showing when I want to send this person a new Imessage.  I don't want an old conversation appears constantly when I am a Messenger contact.  I have an Iphone 5s

    I don't know, but let me see if I understand what you're asking. You do not want to see the thread you have with a particular contact when you go to send them another message? The only way to do this is to remove the previous message thread. If you send a message to someone that you already have a thread of conversation with, it will continue to post in this thread. There is no such thing as having multiple threads with the same person. All conversations with the same person would remain in the same thread, unless you remove the previous discussions. If you delete your previous conversation, when you go to start a new conversation, he won't have any of the other answers.

  • I transferred my pictures from the camera and they appear only in the last download and not events.  I tried everything, how can I get the events?

    I transferred my pictures from my camera to my mac, and they downloaded with the only place wherever they appear in "the last download" but not in "events".  I also downloaded on my macbook and had the same response.  I've never had this problem before and have tried everything.  How can I get them to appear in the "events"?  Since my last camera download, I have create a second library, but they are not more in the events.

    CTRL-click a picture on the last import, then select "Show event.  It shows the event?

  • my windows xp does not start and it only shows the arrow and a black screen in the Middle, what can I do to solve this problem. __

    my windows xp does not start and it only shows the arrow and a black screen in the Middle, what can I do to solve this problem.

    Try to restart your machine and pressing F8 before the spash screen Windows appears.  Choose the option "last last known good configuration".

    If this fails, you can try to repair your installation of starting for the original CD-ROM for Windows XP installation and choosing the option 'Fix' when prompted.

  • LifeLog only show the past 3 months of data.

    My Lifelog is only show my data in the last three months. Can someone please?

    Thank you very much.

  • Only the last account used office is visible on the computer.

    Hi, already, when I booted my pc, in Windows 7, all the accounts (including comments) appeared on the "Office" before that any password has been entered (for each account).
    Recently, something happened and then to start I see only mine, or the last used,... I also see "other".

    I've obviously changed a setting somewhere in Control Panel, but also recently has some malware (properly deleted) who could have done it?

    I'm not a C:\Users\Public\Desktop...as suggested in another thread.

    After searching (in vain) help and support, and then also the sections of Panel control... and also some related items possible in this forum.

    Can someone please advise, how I can return to the list of all the user accounts, the on-screen "start windows".

    Thank you

    lethal42

    I'm not a C:\Users\Public\Desktop...as suggested in another thread.

    C:\Users\Public\Desktop is a hidden folder.

    See if this tutorial will help.

    http://www.SevenForums.com/tutorials/182279-logon-screen-fix-showing-only-other-user-last-logged-user.html

Maybe you are looking for

  • I NEED an operating system?

    Hello, at the moment I'm building a computer. What I was wondering is, are you able to run a computer normally without OS? If I could, I'd still be able to do things such as running iTunes, play music, watch videos, play games and so on? I think to i

  • Activation of Windows 7 on an SSD with the same product key.

    Original title: forget to disable Windows 7 key before moving. Hello, here is my situation (I've seen another thread like this but I have more specific questions) I have a laptop and it was the key to license Windows 7 Pro SP1. I recently bought an s

  • How to encode the string

    Hi I want to send the string encoded on server I do not have now encode this string it please help me.

  • Run a level trigger line before a statement-level trigger

    HelloI'm trying to make sure that a row-level trigger fires before a statement-level trigger (the opposite seems to be the default!). Initially I tried to use the FOLLOWING Clause in the statement-level trigger, unfortunately, this has resulted in th

  • PrimaryIndex County

    I have a doubt about cache.The environment is transactional and configuration options by default.I have primary Index like this:private PrimaryIndex < Long, EnSomeEntity > pkSomeEntityById;I save on it on elements of 100000000 (100 million) .A huge a