Need to retrieve the most recent record per deposit number

Can someone please show me a way to solve my problem or at least point me in the right direction.
I have a simple bibliography table called mdd_biblio that has 3 fields:
bib_mdd_no this is a deposit number
bib_upd_by person who updated the record
bib_upd_date date the record was updated (timestamp)
A deposit might have more than one bibliographic entry with either the same date or a newer date and, the deposit might have one or more person updating the bibliography
The table has 4974 records but only 1867 are unique deposit numbers
All I want to do is select a single record that indicates when the deposit was last edited and and who did the editing (as indicated by the *). I don't care which record it is as long as it is the most recent date.
The following query retrieves 1944 records (67 duplicates) and has eliminated 3000 duplicates but hasn't eliminated them all. Why?
select unique(bib_mdd_no), bib_upd_by, bib_upd_date from mdd_biblio
order by bib_mdd_no
M64C/16-001 MDD 13-SEP-07 *
M64C/16-001 MDD 13-SEP-07
M64C/16-002 DPROUXE 30-NOV-07 *
M64C/16-002 MDD 13-SEP-07
M64C/16-002 MDD 13-SEP-07
M64C/16-003 DPROUXE 29-NOV-07 *
M64C/16-003 MDD 13-SEP-07
M64C/16-003 MDD 13-SEP-07
M64C/16-004 MDD 13-SEP-07 *
M64C/16-004 MDD 13-SEP-07
M64C/16-005 MDD 13-SEP-07 *
M64C/16-005 MDD 13-SEP-07
M64C/16-006 DPROUXE 03-DEC-07 *
M64C/16-006 MDD 13-SEP-07
M64C/16-007 MDD 02-OCT-07 *
M64C/16-008 MDD 02-OCT-07 *
M64C/16-009 MDD 02-OCT-07 *
M64C/16-010 MDD 02-OCT-07 *
I don't understand why of these duplicates still show up here since 3000 have been eliminated..
To Reiterate: What I really need is a simple query to retrieve the most recently edited record for each deposit number regardless of the updater's name. I need this in order to build a summary table from this and 15 other tables.
Thanks for any help you can give
Glenn

Usually it is done somehow like this
select bib_mdd_no,
       bib_upd_by,
       bib_upd_date
  from (select bib_mdd_no,
               bib_upd_by,
               bib_upd_date,
               row_number() over (partition by bib_mdd_no order by bib_upd_date desc) r
          from mdd_biblio
where r = 1
order by bib_mdd_noRegards
Etbin

Similar Messages

  • Select the Most Recent Record

    I have a 2-page report that is grouped by employee, where the first page is a standard letter except for address, and the second page is a reproduction of a scanned form that the employee had returned.  The employee may have returned several versions of the form over time, updating it each time.
    I would like to have the report only pull in the most recent scanned image, ignoring all prior images.  I'm struggling with the correct record selection criteria. 
    Any help would be appreciated.
    Thank you.

    Hi,
    If you have any date field in the data base that updates the time whenever the image is updated then use that date field in the report-->record sort expert and use ascending order. Now place the image field from the data base in the group footer of Employee which shows the latest image. If you want the old one then goto record sort expert and change the order for date field to descending.
    Regards,
    Raghavendra

  • Retrieve the most recent history records from a history table

    I have a table which stores movement of applications or files. There could be any number of history records for any file in this table. I can know who has a given file right now by using max(date) and the unique id field using the query below:
    SELECT IS_WITH FROM APPLICATION_MOVEMENT WHERE DATE_SENT = (SELECT MAX(DATE_SENT) FROM APPLICATION_MOVEMENT WHERE APPLICATION_ID = 461)
    However, my problem is, I want to return a list of all the files and who has them currently, how can I get this....i cannot enter the APPLICATION_ID anymore....
    Table Name: APPLICATION_MOVEMENT
    Field 1: IS_WITH
    Field 2: DATE_SENT
    Field 3: APPLICATION_ID

    This?
    WITH application_movement AS
    SELECT 1 application_id, 'Greg' is_with, to_date('01-jan-07') date_sent FROM dual
    UNION ALL
    SELECT 1 application_id, 'Steve' is_with, to_date('01-feb-07') date_sent FROM dual
    UNION ALL
    SELECT 2 application_id, 'Bill' is_with, to_date('01-feb-07') date_sent FROM dual
    UNION ALL
    SELECT 2 application_id, 'Fred' is_with, to_date('01-mar-07') date_sent FROM dual
    UNION ALL
    SELECT 2 application_id, 'Jim' is_with, to_date('01-apr-07') date_sent FROM dual
    SELECT DISTINCT application_id,
           FIRST_VALUE(is_with) OVER (PARTITION BY application_id ORDER BY date_sent DESC),
           max(date_sent) OVER (PARTITION BY application_id)
    FROM   application_movement;
    APPLICATION_ID FIRST MAX(DATE_
                 2 Jim   01-APR-07
                 1 Steve 01-FEB-07Greg

  • Select "most recent" records in abap

    Hi
    how can I select the most recent records in a table by using the abap select statement.
    Example: The 100 rows with the "highest" (most recent) sequence-numbers in a table with documents.
    somehow like this:
        SELECT "most recent" * FROM draw
        INTO TABLE gt_doklist
        UP TO 100 ROWS
        where ...
    Has anybody an idea?
    Thanks in advance,
    Willi

    Actually I believe that all the answers are wrong.
    I believe that there will never be a single statement. If you need to determine the last 100 records for a special user you first need to determine the highest document number.
    this can be done by
    select max( document_number ) into document_number from table where username = username.
    Any descending sorting order or group by etc. will never make sure that you get the last one. For a simple reason What should the select statement look like that makes sure (in combination of any cursor applied)? Its impossible!
    If you now need the latest 100 records for a single user its the same problem like buffered number ranges. There is no way to perform that task because there is no database routine or sql statement to do so. And 1.5 million records are too much to try out or select everything.
    You could do an assumption that the last 100 for that user have been posted during the last 1000 or last 10.000 records, select them and filter out.
    Alternative you can perform the following select statement for 100 times. Using an index on document number and user might not be such a performance killer if its only done for one user during his online dynpro process:
    data: max_number type char10.
    select max( documentnumber ) into max_number from table
      where username = username into [structure].
    max_number = max_number + 1.
    do 100 times
    select max( documentnumber ) from table intomax_number
      where username = username and docnumber lt max_docnumber.
    select * from [db_table] into [structure] where docnumber = max_number.
    append [structure] to [table].
    enddo.
    Of course that just draft coding... apply if statements and so on...
    Even though its pretty poor, its the only way to do. Any select statement will never garantee what records you will get if you do not restrict accordingly and if the restriction has to be made on document number, but if there is no way to get the max_number - [100 last records of this user], there is no solution using one statement.
    Thats it.
    Edited by: Rob Burbank on Feb 25, 2010 8:52 AM

  • Select most recent record prior to a target date

    Let's say I have a set of unique records with the following dates:
    11/15/08
    11/30/08
    Is it possible to select only the most recent record prior to a user-entered target date (e.g., 12/1/08)?  So in this case, only the record dated 11/30/08 would be selected for the report.

    Use the record selection formula like this
    {Date field}<={?Date Parameter}
    And also wrtite the group selection formula like this
    {Date field}=maximum({Date field})
    This returns the recent value nearer to the date entered in the prompt.
    Regards,
    Raghavendra

  • How to get the Most RECENTLY installed JRE path and version ?

    Hello Experts,
    I am working on Installshield, and for some purpose, I need to get the MOST RECENTLY installed JRE version and Path. Now I have two choices :
    1. Go into the directory " C:\Program Files\Java\" and get the most recently changed directory, ( that will be the installation directory of the most recently installed JRE ). And then search in the registry under : HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment/ and look for the version which is having
    the value of the key INSTALLDIR as the above found Installation Directory.
    But in this approach, I'll never find the Installation dir or version, if the JRE is installed somewhere else than the default location.
    2. Now this is the reverse. I first search in the registry, and get the Installation Directories of all the versions installed in the system, and then look at the file attributes ( may be by using some batch file ) and see which one is most recently installed.
    My question is, is there any other way, by which I can get the most recently installed JRE's installation Path and version? Or can we trace it during the installation itself ? I mean when we install the JRE, it creates some log files in %TEMP% directory. Is it possible to trace the version and installation directory of the most recently installed JRE from the log file ?
    Thanks
    Gagan

    Rendering times are pretty much based on processor speed if I have that right. Not much you can do about that other than buy a new computer. Your day to day work in the finder and accessing of files would be faster with your boot drive internal. One thing you can do is ensure your FCP System Settings are on the fastest disk you have. If you put a pair of drives internal and made a RAID volume for them you would improve your write speed when capturing and for any other read/write operations. You would have to be sure you kept that backed up properly because you double the odds of a failure when two drives spread the data between them. There are many RAID options.
    You could also bump up the RAM but you'd have to look at your processes to see if you are being limited by RAM. I'm guessing not but it's not impossible. If you are accessing scratch disks due to RAM limitations that would be one thing you could do.
    I would never bother connecting an external via USB if there was an esata or firewire option. I use an esata card internally to give me access to estata storage. I also keep an external FW800 drive for a mirror backup of my boot drive. All my data and booting is internal with all my backups external. Each internal has an external and I have additional externals that I keep off site to protect against fire and theft.

  • My Mac OS, 10.5.8, won't support the most recent Firefox and I need the most recent version it WILL support and how to get it, as it's not on this site.

    I need a way to get a more recent but not current version of Firefox that my computer, a PowerPC processor Mac, will support. I am running OS X version 10.5.8. This processor/computer will not run Lion and the most recent version of Firefox will not run on it either.
    On my second computer, same type, a newer version of Firefox crashes constantly while in Yahoo!

    Firefox 3.6.x is the last available from Mozilla for PPC Macs. <br />
    http://www.mozilla.com/en-US/firefox/all-older.html

  • I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why?

    I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why? I saw a thread saying to purchase the newest software (that was posted a few years ago) I paid 4.95 for the software and it's still saying it can't be updated.  Am I just SOL??

    The 1G iPod can only go as high as 3.1.3. The 1G does not have an internal speaker or volume buttons on the upper left edge.
    Identifying iPod models
    To more easily find compatible apps:
    iOSSearch - search the iTunes store for compatible apps.
    Apple Club - filter apps by iOS version.

  • HT6162 My phone will not let me download the most recent update for iOS 7.1. It says I need a wifi connection and will not allow me to push the 'Download & Install' button, even when I am at home and my wifi is on. How do I fix this?

    My phone will not let me download the most recent update for iOS 7.1. It says I need a wifi connection and will not allow me to push the 'Download &amp; Install' button, even when I am at home and my wifi is on. How do I fix this?

    Unfortunately yes, though technology would never move on if it kept to older standards and did not strive to do more.
    The app store always gives you the option to use a previous version of the app IF it is available for your device.
    Sorry but you are stuck without new hardware.
    PJRS

  • I need to know how to delete the most recent version of Firefox. I JUST downloaded it tonight and my computer doesn't have that little edit bar to work with so I can download the proper Adobe player and my internet has been screwed up ever since I downlo

    I need to know how to delete the most recent version of Firefox. I JUST downloaded it tonight and my computer doesn't have that little edit bar to work with so I can download the proper Adobe player and my internet has been screwed up ever since I downloaded the new version of Firefox. I just want the old version of it back since I apparently can't download the Adobe stuff that is necessary to keep my computer safe from Hackers. It sure would have been nice to know there was an issue with the new Firefox Update BEFORE I uploaded it. I have Vista which is usually an issue with both Adobe and Firefox. I don't seem to be able to run much of Adobe at all on my computer because of the Vista.
    == This happened ==
    Every time Firefox opened

    I have also noticed all my settings won't stay set, example....I removed the check mark from "third party cookies", the when I close Firefox and reopen the check mark is back, also my tool bar has screwed up....can't reset, been having trouble the up grade.

  • My Ipad is saying that I have the most recent update (5.1.1) when I clearly do not. It will not allow me to update to i0S8. Does anyone know what I need to do to get to the newest update?

    My Ipad which has a capacity of 28.5 GB (and I have used less than 10), is telling me when I want to update the ios system that I have the latest version (which they say is 5.1.1). This is not true. As I need version ios8 to download apps. Can anyone tell me why I cannot download the latest version and why my ipad keeps telling me I have the most recent version? I went into my Itunes account and tried to update it there while connected, but it is also telling e I have the latest version (5.1.1) too! Why is this happening and what can I do to obtain the upgrade?

    Unfortunately yes, though technology would never move on if it kept to older standards and did not strive to do more.
    The app store always gives you the option to use a previous version of the app IF it is available for your device.
    Sorry but you are stuck without new hardware.
    PJRS

  • Do I need all the updates, or just the most recent?

    I'm in the process of cleaning out my hard drive to free up some extra space. In my add/remove programs menu I have "J2SE Runtime Environment 5.0" updates 3, 4, 6, 8, and 9. Do I need to keep all of these, or only the most recent one? I could free up almost half a gigabyte if I delete the older ones, but I don't want to do so and then find out that I screwed up my computer. So my question is, do the new updates simply compliment the old ones, or replace them entirely? Can I safely remove updates 3, 4, 6, and 8?

    Just one's enough. Get rid of the old ones.

  • Need to Update Flashplayer but I have the most recent one.

    Hi. I will start by saying that I am computer illiterate, so I will need careful and patient help. Here is my issue: Whenever I try to play a video, You Tube or otherwise, I am told I need to update flashplayer. When I go to update it, I am told that I need to close windows messenger. According to my settings, messenger is disabled. Whenever i get rid of the messenger box, I am told that installation is incomplete.  Also, according to my settings, I have the most recent version of flashplayer installed, 10.1.102.64, the one for IE.
    On a totally unrelated note, what is the difference between Spyware and anti virus protection? I have McAffee.
    Will appreciate your help.

    Hi, Thanks for stating that you are not so experienced with computers. We don't have any way of knowing until we're told:-)
    I need your computer info, as XP, Vista, Win7? Also what version of the IE browser? If you don't know, go up to Help at the top of the IE and click on it, then About Internet Explorer.
    I'll post the info on Anti-Virus/Spyware next.
    Thanks,
    eidnolb

  • I have an academic version of Final Cut Studio on my laptop and recently purchased the most recent Full version of Final Cut Studio. Do I need to uninstall the academic version before installing the new version?

    I have an academic version of Final Cut Studio on my laptop and recently purchased the most recent Full version of Final Cut Studio. Do I need to uninstall the academic version before installing the new version? I ask because this is not an upgrade, but a completely new version.

    I'm with Jim on this.  It always seems to work out better if you do not install over another version.  You can use this app (freeware - thanks to Jon Chappel) to completely remove ALL Final Cut Studio apps and components: http://www.digitalrebellion.com/fcsremover/
    Once that's done, install your newly purchased version.
    -DH

  • IPhoto error, won't open, says it needs the most recent version

    I have an early 2009 mac pro desktop with 6 megs of ram. iPhoto error, won't open, says it needs the most recent version to work but the most recent version won't work either because I have Mountain Lion. I downloaded iPhoto from the App store and the store said "you can't download the most recent version because you don't have Mavericks - would you like to download an older version?" So I said yes and downloaded it. It is actually the Mavericks version that downloads anyway. So I used an older version from my other computer and updated it to version 9.4.3. When I try to open it it says you need the most recent version. My library is on an external drive which was downgraded from Mavericks back to Mountain Lion because Mavericks wouldn't work properly on my computer. Now no version will open.
    What can I do? Thank you for your help in advance.

    The exact error message is:
    THe library "iPhoto Library" cannot be opened. To open it, you must upgrade to the latest version of iPhoto. Then the Quit button is at the bottom of the dialog box.
    I did install iPhoto 9.5 when I installed Mavericks, Keep in mind that all of my photos are not on the boot drive but they are on an external drive. I then got rid of Mavericks and did a fresh install of Mountain Lion then I copied the contents of a previous drive that only had Mountain Lion on it. 9.5 wouldn't open in Mountain Lion so I copied an older version from another computer and updated it to 9.4.3. 9.4.3 says you must upgrade to the latest version and 9.5 says you need an older version. So I am stuck now.

Maybe you are looking for

  • Error while create/change configuration an application

    Hi, while doing the configuration application. when i am trying to create/change configuration an application. i am getting following error. Error: Service cannot be reached What has happened? URL http://os1gvzg.gemsconsult.com:8000/sap/bc/webdynpro/

  • Root element is missing - Response from a WCF service - WCF-Custom adapter

    hi BizTalk experts, In the production environment, as soon as the response is getting subscribed by the orchestration, the orchestration instance is getting suspended and the error that shows up in console is  "Root element is missing". I have checke

  • First connection with IC  webClient

    Hi, I've got a strange behaviour when I execute CRM_IC (in se80).  The IE is launched automatically and after a while (short time) a second IE shows up. In the first one I've got a Interaction Center framework which is visible but with only two butto

  • Execution Plan Run is not visible in Current Run tab

    Hi, I have created the EP and I have build the EP successfully. After that I am clicking on the Run tab. It says the task has been submitted succesfully to the DAC server. But, when I am seeing the status in the Current Run tab and also in the Inform

  • Object Graphics deleted on paint component

    Hello everybody! I have a question about the object graphics when paint a component in it. I'm trying to paint a component in a image, and after show it in the screen. The problem is that in order to make it possible, I have to put the function that