Determining which record has max value

Hi,
In my table I have the following cols:
Account_Id, Contact_Id, Modified_Date
In this case, one contact_id has multiple account_id's but I want to return only 1 account_id per contact, based on the max modified_date for the accounts.
Any help with this sql would be appreciated....
Thanks,
Christine

select *
from
select account_id, contact_id, modified_date, max(modified_date) OVER (partition by account_id) as Max_date
FROM some_unspecified_table
where max_date = modified_date
Message was edited by:
taf304

Similar Messages

  • Getting error Data record has grouping value "" in

    Trying to change Address data in HR using BAPI_ADDRESSEMPUS_CHANGE
    Getting error message : Data record has grouping value "" instead of ""
    Please advise.
    Thanks,
    Bhaskar

    Hi,
    I assume the following system situation exists:
    The new Infotypeframework NITF is inactive for PA30. Flag CCURE PC UI is activated in T77SO. You are using ESS based on Web Dynpro which uses the new Infotypeframework.
    Here we have to differentiate between infotypes which are participating in the data sharing functionality and all other infotypes. Such as:
    Infotypes without Data Sharing:
              - Infotype checks     => module pool
              - Infotype update     => SAPFP50P/SAPUP50R
    Infotypes with Data Sharing:
              - Infotype checks     => module pool
              - Infotype update     => NITF
    ATTENTION:
    BAdI HRPAD00INFTY is not processed in this case (importing parameter NEW_IMAGE is always space). Instead the BAdI HRPAD00INFTYDB of the NITF is been processed.
    The following notes (1 and 2) will solve the problem. Note 3) solves an involving problem caused during the deletion process of a personnel number.
    1) 783499 - Incorrect framework synchronization
    2) 845592 - Incorrect framework synchronization - Retroactive accounting
    3) 844998 - PU00: Termination when deleting a personnel number
    Hope this will help!
    Regards,
    Sibylle

  • How does DIADEM import TDMS files? How gets every channel his number and groupindex? How can I determine which channel has which groupindex and number?

    I store different channels in a TDMS file.
    I like to have a time channel at the first position with group index 1 and number 1.
    When I read the TDMS file with DIADEM the time channel (Float64) is on a differernt position, and the channels are not sorted alphabetically.
    Here are my questions:
    How does DIADEM import TDMS files?
    How gets every channel his number and groupindex?
    How can I determine which channel has which groupindex and number?
    Best regards
    Joerg

    Hi Jörg,
    i suppose that you´re programme whose create the *.tdms file is writing on false position. Try to create datas with timechannel on first indes in diadem, then save it and then open it again. you see that all is correct. So please tell me what programm in what version do you use and please attache it here.
    Did you use the library for creating *.tdms files like in the link ?
    http://zone.ni.com/devzone/cda/tut/p/id/6471
    Here you find the gtdms_8.x.zip - when you extract it and opened the *.llb you find vi´s for all functions e.g. writing 2d array of strings to *.tdms file
    when you open the subvi´s then you see how created and writing datas/structure to *.tdms files. Because *.tdms is binary you can´t see structure with open it in editor.
    When you don´t have Labview you can use the 30 days test of current version 8.5 under following link
    german version download link
    https://lumen.ni.com/nicif/d/lveval/content.xhtml
    english version download link
    https://lumen.ni.com/nicif/us/lveval/content.xhtml
    Hope it helps
    Best Regards

  • JSF: How to determine which element has the focus?

    Hi all,
    I have a JSP with some input fields and a text area. When I press "ENTER" the data I have entered should be saved. That works fine (I use JavaScript to catch the keyPressed-event). But when I want to insert a new line in the text area, I press ENTER too and this invokes the javascript function. So it�s not possible to insert a new line in the text area. And I don`t want to save the data when I�m just inserting a new line.
    is it possible to determine which element has the focus at the moment of pressing ENTER? if it`s the text area then I won�t save the data and inserting a new line is possible? Or how to say: "Insert an new line if the user presses SHIFT+ENTER" or something like that?
    I�m using JSC for my application and this is my JS-function:
    function checkIt(evt)      
    var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
         if (charCode == 13)
              document.getElementById('form1:bt_Save').click();
              return false;
              return true;
    I�m looking for something like that:
    if(charCode == 13) {
    if(document.getElementById('form1:textArea').hasFocus())
    doNothing...
    else {
    document.getElementById('form1:bt_Save').click();
         return false;
    thanks for any help

    Hi,
    I searched through many forums (js of course too) but
    I couldn�t find a solution. Everybody knows how to
    set the focus but not how to get it. We often use
    JSF/JSP with javascript and maybe somebody here has
    another approach to this problem (how to solve it
    using jsf itself or anything else)?Take easy. I just suggested to search in a JavaScript forum , in your question you didn't mentioned this. Good luck man.
    Cya.

  • Which table has Batch# value as seen on PO line item ?

    Hello friends,
    The Purchase Order line item shows a field for Batch-number.  However, this field is not there in EKPO table.  So can someone tell me which table has the Batch# value (as seen on PO line item) and how it is linked to that line item's record in EKPO table ?  Thanks for your help.
    - Chetan

    Hello,
    I found one field in table EKET. (EKET-CHARG)
    BR
    Csaba

  • Error Data record has grouping value "" instead of 99

    Hi,
    We are implementing ESS and MSS for EP7.0 with ECC 5.0 and we get the following error: Data record 0000005900090      9999123120010910000 has grouping value "" instead of "99" when we try to edit and save the bank information.
    Please advise! Thank you!

    same error ,
    the report did not fix it .
    its coming up when ever i am trying to do a global assignment actions ...( this is occuring only for people with benefits infotypes)
    any idea..
    Please let me know
    Thanks

  • How  can i determin which tab has been clicked??

    hi there
    how do i determine which one of the tabs in a tabbedPane has been clicked? do i add ActionListener to the tabbedPane or its sub JPanel?

    I import them all, it finallly compiled, but I am not sure if they are ok. here is the codes
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    TabbedPane = new JTabbedPane();
    TabbedPane.addTab("Easy", easyTab);
    TabbedPane.addChangeListener(new ChangeListener()
    public void stateChanged( ChangeEvent ce )
    Object source = ce.getSource();
    if (source == "Easy")
    currentTab = "easy";
    does it look all right to you?

  • Determining which user has acquired a task

    I'm trying to determine which, if any, user has acquired a human task.
    I'm working with the Java API to interface with the SOA server. I can't find any APIs which might allow me to do this. Does anyone know if this is possible?

    Hi  Gerben,
    Thanks for the reply.
    But I noticed when I  killed a job and checked in the  last modified by option I didn't  find my user name there. It was displaying the user who had modified that job definition last time.
    Thank you
    Avdhesh

  • How to determine which application has focus in Windows

    Hello all-
    I'm trying to work around the "Labview freezes when there is large data on the clipboard known issue" (http://forums.ni.com/t5/LabVIEW/Labview-freeze-when-accessing-a-custom-menu-with-data-on-the/m-p/200...) and one thought is to try to determine if Labview has focus, and if it does then clear the clipboard.  If Labview doesn't have focus, then let the user use the clipboard.  This would be a good work-around because it would let the users paste screen shots and such into notes files and wouldn't risk a nasty clipboard/ menu/ freeze-crash.
    My initial search for determining windows application focus, came up empty though.  This old thread (from 2005) pretty much covers it:
    http://forums.ni.com/t5/LabVIEW/Is-there-a-simple-way-to-programatically-tell-which-VI-window/m-p/20...
    The "Is Frontmost' property does not do it.  I need to determine if Labview has focus, as opposed to Windows, notepad, firefox, etc.  I also reviewed the commad prompt commands and didn't find anything immediately helpful there either.
    Any ideas?
    Thanks,
    Casey
    Solved!
    Go to Solution.

    Christian-
    That's perfect!  By using GetForegroundWindow, GetWindowTextA and GetWindowFileNameA in user32.dll I can detect which window has focus.  If Labview has focus then I programatically clear the clipboard so the user can still use it when not clicking on Labview windowns, but also we do not risk a freeze and crash because of the clipboard/ freeze bug.
    I briefly thought about using the .NET versions of these functions, but because that would have forced an upgrade to at least .NET framework 3.0 for all of my user computers, I decided on the unmanaged user32.dll.
    Thanks for the suggestion.  I think I'm pretty close to a work around here that should last me until they fix the clipboard/ freeze bug.
    Thanks,
    Casey

  • How to determine which user has an Access 2013 databse open

    How can I tell which user / PC has opened a Backend Access database?

    If the file is stored on a server and you have access to it, you could check in Computer Management, then go into System Tools, Shared Folders, Open Files, and you should find the file listed there along with which user has it open currently.

  • Is it possible to determine which user has opened a PDF on a network?

    Hi Everyone.
    We frequently have a situation where users open PDFs saved on the network with Acrobat, and then leave them open.
    Then if other users need to edit the same PDF, they have no way of knowing the PDF is locked until they try to save and get this error:
    "...The file may be read-only or another user may have it open... "
    In this situation it would be useful to be able to interrogate the locked PDF to see which user has locked it open, and maybe to even force close the open session.
    Does anyone know if any of this is possible?
    Many thanks in advance.
    Cheers,
    Andy

    It's not something that Acrobat can show. File 'locks' in Acrobat are not controlled by the application as they are in programs such as Word or InDesign - which write a lockfile to the folder - instead we rely on the server OS to flag each file. Information on who is accessing a file on a network share is only available at operating system level via the machine which hosts the share (e.g. via a net session command).

  • Create subnumber for asset which already has book value RM1.

    Hi everybody,
    Can i create subnumber for asset which has been depreciated until RM1 book value ? This asset has a few quantity and need to be breakdown to different cost center ? If yes, how ? AS11 or AS94 ?

    Hi,
    Thanks Andreas. However, the asset is an old asset (already reached RM1 book value). I have tried to use AS94, but hits an error " Legacy data transfer year is not last closed fiscal year 2007". FYI the take over date in the system is 31/3/1998 while closed fiscal year is 2006. Now we are in fiscal year 2007 (Apr to Mac). If i were to change the take over date to become 31/3/2007, is there any impact to the depreciation run for other assets in the system. I'm worried if i change the take over date, the depreciation will get haywired.

  • How to develop this report/Query that selects records with MAX Value

    Hi,
    My requirment is to develop a report to show all emp whose policy is going to expire ith in the user selected date intreval...
    Emp_ID--App_Date-Policy_Strt_Date--Policy_End_Date--App_Status
    101.01.2007---BlankBlank--
    NEW   (New application for a Medical Insurance policy raised for employee)
    101.01.2007---01.02.200730.05.2007--
    COMPLETE (policy issued for emp with strt & end dates)
    115.05.2007---01.02.200730.05.2007--
    RENEWAL  (a application is raised to renew emp policy)
    115.05.2007---01.06.200731.12.2007--
    COMPLETE  (policy issued for emp with strt & end dates)
    115.12.2007---01.06.200731.12.2007--
    RENEWAL  (a application is raised to renew emp policy)
    115.12.2007---01.01.200831.05.2008--
    COMPLETE  (policy issued for emp with strt & end dates)
    115.05.2008---01.01.200831.05.2008--
    RENEWAL  (a application is raised to renew emp policy)
    115.05.2008---01.06.200831.05.2009--
    COMPLETE  (a application is raised to renew emp policy)
    So EMP 1 got valid policy untill 31.05.2009.
    When a user executes a query to show all employees whose policy expiry date intreval (01.05.2008 to 31.05.2008)
    it shouldn't show Emp 1 as he got  valid policy untill 31.05.2009  but currently it is showing Emp 1....
    How can i achieve this
    Thanks

    Hi
    Thanks for the update
    I created variable on Plc End end
    If user enter show all emps whose policy is expiring in MAY (01.05.2008---31.05.2008) it is displaying EMp 1 as well but emp 1 has a policy which expires in 2009
    Thanks

  • Script to determine which user has assigned a certain printer

    Navation: System Administrator > Install > Printer > Register. I am trying to delete an old printer, but get "this printer is referenced the printer profile option. You cannot delete a printer while it is referenced."
    I am looking for the table/report/whatever that will allow me to see which user is assigned this printer.
    Thanks...colin

    Colin,
    Please see the following documents, it should be helpful.
    Note: 370372.1 - How To Effectively Remove An Oracle Applications Printer
    Note: 102286.1 - How to Delete a Printer Registered with Applications
    Note: 105260.1 - Getting Error Message When Trying to Unregister a Printer
    Note: 201945.1 - How to list E-Business Suite Profile Option values for all levels using SQLPlus
    Note: 367926.1 - How To Find All Users With A Particular Profile Option Set?
    Regards,
    Hussein

  • How to determine which drive has the most recent backup?

    I have a few drives that contain backups of files. What would be the easiest way to figure out which of the drives has the most recent backup? When I sort by date, the folder shows one date, though the files inside show a different date? Is there a way to quickly check the drives to find which is the most recent?
    Thanks.

    the folder modification date isn't reliable, as is only tells of changed in the folder, but not in subfolders. there is no efficient way. I however highly suggest Time capsule, it is WAY easier and you can ask it not to sync the System data and/or applications, so it would prevent this hassle.
    You could try this: go to the first drive, type different letters, like a for instance, and see which file is the most recent document/folder.
    do the same thing on the other drives and compare.

Maybe you are looking for

  • Problem with Counter in Query

    Hi Experts, There is a problem in my query output. I have a CKF for sales documents number created with replacement path which gives the correct count of number of Sales documents. But the req here is to create two more counters which will be countin

  • Web analysis issue

    hi, I am trying to develop a new report in Web analysis. I followed these steps: 1. file > new > Document 2. file> database connection > analytic server 3. drag the spreadsheet option and i am on Data Layout tab wherein i can select column , rows and

  • Iphone to iphone SMS not working

    Been looking for a solution to this for a while but cant seem to find a fix to this. When i am NOT in a wi fi area I dont seem to receive SMS from other iphone users.  ( i do though receive SMS from non-iphone users, the problem is isolated to SMS fr

  • Can i pass mulptiple records in bapi_po_change,BAPI_OUTB_DELIVERY_CHANGE...

    Hi guys,             I have to create a report where i will read a xls file, from each record in this file i have to run one of the following FM BAPI_PO_CHANGE BAPI_OUTB_DELIVERY_CHANGE L_TO_CONFIRM BAPI_GOODSMVT_CREATE depending on catagory of recor

  • What causes time remap to be unavailable

    CS4 I don't know much about time remapping but I have used it long enough ago to have forgotten what ever I might have known. I did remember setting Layer/time/timremap, but when I select a layer and try to do that the `remap'  menu item is unavailab