Stuck with trying to get the max of the table version number

We have a custom table that contains information on the work packages installed.

Whenever a package is updated, a new entry is added to the table, with an incremented version number.

Some examples of data:
GET sampledata
WITH sampledata AS
     (SELECT 'TEST0003' NAME
           , '1.1' VERSION
           , 'Installed Work Packet TEST 111' description
           , '18-Jul-2003' install_date
        FROM DUAL
      UNION ALL
      SELECT 'TEST0003'
           , '1.2'
           , 'Installed Work Packet TEST 111'
           , '18-Aug-2003'
        FROM DUAL
      UNION ALL
      SELECT 'TEST0003'
           , '1.3'
           , 'Installed Work Packet TEST 111'
           , '18-Sep-2003'
        FROM DUAL
      UNION ALL
      SELECT 'THIS2003'
           , '2.1'
           , 'Something Else'
           , '01-Jul-2009'
        FROM DUAL
      UNION ALL
      SELECT 'THIS2003'
           , '2.2'
           , 'Something Else'
           , '10-Aug-2009'
        FROM DUAL
      UNION ALL
      SELECT 'THIS2003'
           , '2.3'
           , 'Something Else'
           , '15-Nov-2009'
        FROM DUAL)
SELECT *
  FROM sampledata;
I would like to know how to return only the most recent version of each package of the table, but I can't get out.

For example, the sample data above, I would like to only include:
NAME               VERSION                DESCRIPTION                            INSTALL_DATE
---------------------------------------------------------------------------------------------------
TEST0003           1.3                    Installed Work Packet TEST 111         18-Sep-2003
THIS2003           2.3                    Something Else                         15-Nov-2009
I see she has to somehow select MAX (version) for each different "NAME", but can't get my head around the syntax. What I have to GROUP BY "NAME" and then select the MAX (VERSION) of that?

Any advice much appreciated.

Thank you

Thanks for the sample date!
Yet another version:

SQL>WITH sampledata AS
  2       (
  3          SELECT 'TEST0003' NAME, '1.1' VERSION, 'Installed Work Packet TEST 111' description,
  4                 '18-Jul-2003' install_date
  5            FROM DUAL
  6          UNION ALL
  7          SELECT 'TEST0003', '1.2', 'Installed Work Packet TEST 111', '18-Aug-2003'
  8            FROM DUAL
  9          UNION ALL
 10          SELECT 'TEST0003', '1.3', 'Installed Work Packet TEST 111', '18-Sep-2003'
 11            FROM DUAL
 12          UNION ALL
 13          SELECT 'THIS2003', '2.1', 'Something Else', '01-Jul-2009'
 14            FROM DUAL
 15          UNION ALL
 16          SELECT 'THIS2003', '2.2', 'Something Else', '10-Aug-2009'
 17            FROM DUAL
 18          UNION ALL
 19          SELECT 'THIS2003', '2.3', 'Something Else', '15-Nov-2009'
 20            FROM DUAL)
 21  SELECT   NAME, MAX(VERSION), MAX(description)KEEP (DENSE_RANK FIRST ORDER BY VERSION) AS description,
 22           MAX(install_date)KEEP (DENSE_RANK FIRST ORDER BY VERSION) AS install_date
 23      FROM sampledata
 24  GROUP BY NAME;

NAME     MAX DESCRIPTION                    INSTALL_DAT
-------- --- ------------------------------ -----------
TEST0003 1.3 Installed Work Packet TEST 111 18-Jul-2003
THIS2003 2.3 Something Else                 01-Jul-2009

URS

Tags: Database

Similar Questions

  • Has anyone else tried to get the English version of Windows 7 ISO of the MS download site? I have a valid key and the website let me only to get the Korean or French version

    Has anyone else tried to get the English version of Windows 7 ISO of the MS download site?  I have a valid key and the website let me only to get the Korean or French version.  English useful MS tech 'UN' told me that the English version is no longer supported and should I install one of these versions and then download the language package and install it.  Has anyone else been in this position?  It was a horrible experience with the online chat with technical support.

    Marcus,

    Some people have persevered with contact support via the link on the MS download site and have finally received the download links temporary for an English version.  [You will find these discussions if you looking for the Korean forum as most people in your situation included that word in their title of the question.  I don't remember one of these threads containing any additional info that would be of no use to you.]

    If that does not appeal to you & you still cannot find your original installation disks, then buy a disc-relocation

    1. Amazon now stock reinstallation DVD for just a quid [the link is for their UK site site American stocks also to them].
    2. These seem to be exactly what they claim they do not have a product key and that they are specifically described as being for reassembly only - in other words, they are not an attempt to distribute pirated Windows.
    3. You must use your own product key for activation.
    4. Make sure order you Windows 7 edition {Home Premium etc.} that is identified on your certificate of authenticity [the label that contains your product key].
    5. Some of the sellers provide 32 bit and 64 bit DVD, while others provide one or the other.  So make sure you order the right kind.
    6. These discs can do everything what a system repair disc can do, so you'll not need to make a separately.
  • Norton 360 is ready with SafeWeb to get the latest version of firefox?

    Some time ago, I received a warning to wait with the installation of an update of firefox because some parts of Norton 360 - I think it was SafeWeb - would not work. I later received a notification from Norton Norton is now online with Firefox. I have the same problem with Norton 360 again if I will update to the latest version of Firefox?

    Yes Norton 360 v5 is fully compatible with Firefox 9, see

    Firefox 9 is here

  • Get the os version number

    I was able to get the name of the operating system by using intrinsic.flash.system.Capabilities.os
    but I would like to get the operating system version number as well.
    running windows xp 5.1
    but intrinsic.flash.system.Capabilities.os returns only windows xp

    I also went through the other fields in the class of features, I don't think that there is nothing that gives me what I want.
    any thoughts?
    Thank you!

    Have you tried Capabilities.serverString?

  • Stuck with trying to get a decode to match data

    I have this little bit of SQL:
    WITH sampledata AS
         (SELECT '000000000000000000000000000000000010101' schd FROM DUAL
         union all
          SELECT '000000000000000000000000000000001111111' sch from DUAL
          union all
          SELECT '101000000000100000000000000000000000000' sch from DUAL
          union all
          SELECT '000000000000000000000000000000010000000' sch from DUAL)
    SELECT schd
        , sign(to_number(substr(schd, 33))) c0
        , substr(schd, 33) c01
        , substr(schd, 3, 1) c02
        , decode(sign(to_number(substr(schd, 33))),
                         '1', 'Days of week: ' ||
                         decode(substr(schd, 33, 1), '1', 'Su ') ||
                         decode(substr(schd, 34, 1), '1', 'Mo ') ||
                         decode(substr(schd, 35, 1), '1', 'Tu ') ||
                         decode(substr(schd, 36, 1), '1', 'We ') ||
                         decode(substr(schd, 37, 1), '1', 'Th ') ||
                         decode(substr(schd, 38, 1), '1', 'Fr ') ||
                         decode(substr(schd, 39, 1), '1', 'Sa ')) c1
        , decode(substr(schd, 32, 1), 
                     '1', 'Last day of month ',
                     '0', decode(sign(to_number(substr(schd, 33))),
                             '1','Days of week: ' ||
                                 decode(substr(schd, 33, 1), '1', 'Su ') ||
                                 decode(substr(schd, 34, 1), '1', 'Mo ') ||
                                 decode(substr(schd, 35, 1), '1', 'Tu ') ||
                                 decode(substr(schd, 36, 1), '1', 'We ') ||
                                 decode(substr(schd, 37, 1), '1', 'Th ') ||
                                 decode(substr(schd, 38, 1), '1', 'Fr ') ||
                                 decode(substr(schd, 39, 1), '1', 'Sa '),
                             '0','Set Days of Month: ' ||
                                 decode(substr(schd, 1, 1), '1', '1st ') ||
                                 decode(substr(schd, 2, 1), '2', '2nd ') ||
                                 decode(substr(schd, 3, 1), '3', '3rd ') ||
                                 decode(substr(schd, 4, 4), '4', '4th ') ||
                                 decode(substr(schd, 5, 5), '5', '5th ') ||
                                 decode(substr(schd, 6, 1), '6', '6th ') ||
                                 decode(substr(schd, 7, 1), '7', '7th ') ||
                                 decode(substr(schd, 8, 1), '8', '8th ') ||
                                 decode(substr(schd, 9, 1), '9', '9th ') ||
                                 decode(substr(schd, 10, 1), '10', '10th ') ||
                                 decode(substr(schd, 11, 1), '11', '11th ') ||
                                 decode(substr(schd, 12, 1), '12', '12th ') ||
                                 decode(substr(schd, 13, 1), '13', '13th ') ||
                                 decode(substr(schd, 14, 1), '14', '14th ') ||
                                 decode(substr(schd, 15, 1), '15', '15th ') ||
                                 decode(substr(schd, 16, 1), '16', '16th ') ||
                                 decode(substr(schd, 17, 1), '17', '17th ') ||
                                 decode(substr(schd, 18, 1), '18', '18th ') ||
                                 decode(substr(schd, 19, 1), '19', '19th ') ||
                                 decode(substr(schd, 20, 1), '20', '20th ') ||
                                 decode(substr(schd, 21, 1), '21', '21st ') ||
                                 decode(substr(schd, 22, 1), '22', '22nd ') ||
                                 decode(substr(schd, 23, 1), '23', '23rd' ) ||
                                 decode(substr(schd, 24, 1), '24', '24th ') ||
                                 decode(substr(schd, 25, 1), '25', '25th ') ||
                                 decode(substr(schd, 26, 1), '26', '26th ') ||
                                 decode(substr(schd, 27, 1), '27', '27th ') ||
                                 decode(substr(schd, 28, 1), '28', '28th ') ||
                                 decode(substr(schd, 29, 1), '29', '29th ') ||
                                 decode(substr(schd, 30, 1), '30', '30th ') ||
                                 decode(substr(schd, 31, 1), '31', '31st ')
                          )
                    ) schedule                        
      FROM sampledata;
    The idea is that the "ECS" contains information of planning, where 31 1 numbers represent the days of the month.

    The 3rd line of the sample data contains a schedule reports to run on the 1st, 3rd and 13th of the month.

    The SQL returns a match for the 1st of the month, but it does not pick up the calendar for the 3rd or the 13th of the month.

    I thought that since the SQL for the 'calendar' column, that he would return to the 3rd, but it's not to do it, even if the "C02" pass, I can confirm that the value for the 3rd the long is a character, I thought I would be be recognized / corresponding to this line:
    decode(substr(schd, 3, 1), '3', '3rd ') ||
    All advice very much appreciated, thanks!

    PS - I know the code is probably very awkward with my big long list of decodes to the days of the month, but I'm not smart enough for a smoother road!

    Maybe
    decode (substr (ECS, 3, 1), '1', '3').
    Instead of
    decode (substr (ECS, 3, 1), '3', '3').

    Concerning

    Etbin

  • How can I determine the executable version number?

    Hello.

    I have a VI and a specification to build for her.  In the Version of the specification to build information section, I updated the version number auto-increment.  I want to view the version number on an indicator on the front of the executable, but I have not found a property that provides this information. Does anyone know how to get the executable version number? I am aware that it is possible to right click on the .exe in the windows Explorer file, go to properties and get that way, but I want to display on the VI himself.

    On a related topic, I noticed that only the 'construction site' of the version field gets auto-incrémenté. Request of the manufacturer decides when it is time to increment major, minor and set the fields?  Or it will never be auto-increment the construction field and I'm supposed to update other fields manually? (That would actually make sense, but I'd like confirmation).

    Thanks in advance,

    Alejandro

    S ' Please check this if its helpful
    http://digital.NI.com/public.nsf/allkb/935BA7FB426305398625711E0055F1FA
    - And vote for that if you like idea
    http://forums.NI.com/T5/LabVIEW-idea-exchange/get-exe-version-in-LabVIEW/Idi-p/1324119

  • The final version number?

    Hello people, can someone please tell me the final official version of Windows 7 build number? Also is there a link with some information on the final version number.  I hear the 7600 is the build number, but some sites are showing it is the RC version. I just need to know that the fact for a project.

    Thank you in advance.

    The RC build is 7100, sites than what you say you information which is the final version, you need to check their credibility.

    The final build is 7600, more precisely 7600.16835 (I think that the 5 last digits are in the right order...)

    Don't know all link, there is a poster in this forum called Andre Da Costa, he knows the build number and can be a link to check the build number you request. Hello! Please respond quickly, if possible with the results in solutions to your problem!
    -JoelbX
    Of JoelbX son favorite | SkyDrive | Cool "widget" programs

  • I'm trying to download the trial version for Acrobat DC edit PDF files, but when download initializes, it gets to 11%, gets stuck, then gives the message "request from Web Get failed. I canceled, downloaded the installer again and got the same result.  I'

    I'm trying to download the trial version for Acrobat DC edit PDF files, but when download initializes, it gets to 11%, gets stuck, then gives the message "request from Web Get failed. I canceled, downloaded the installer again and got the same result.  I'm on a PC running Windows 8. Any suggestions?

    Hiddm93421458,

    Restart your system and then try again to install Acrobat Reader DC using this link Download Adobe Acrobat free trial | Acrobat Pro DC.

    Let me know if the problem persists.

    Kind regards

    Nicos

  • Hi, I tried to download the trial version free photoshops and after I sign in I get this pop up message saying ' unable to reach adobe servers, please check your firewall settings ", I checked the and there is nothing wrong with the firewall, is

    Hi, I tried to download the trial version free photoshops and after I sign in I get this pop up message saying ' unable to reach adobe servers please check your firewall settings ", I checked them and there is nothing wrong with the firewall, is there a problem with the adobe servers? can someone help me?

    Please try the steps mentioned in: https://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html

  • I'm trying to get the bookmark icon in my toolbar to the right of the icon of the House. I right click on the toolbar, and then customize the icon is displayed in the toolbar. When I close the popup on the toolbar icon in my toolbar disappears.

    I'm trying to get the bookmark icon in my toolbar to the right of the icon of the House. Then, right-click on the toolbar and then click Customize the icon in the toolbar. As soon as I close the pop of toolbar Customize the icon on my toolbar disappears. How can I get the Favorites icon to stay on my toolbar to the right of the icon of the House?

    Two things can cause the Bookmarks button to "disappear" from the Navigation bar when the customization mode is closed.

    1. the Menu bar - with File, Edit, View, etc. - shows.

    Since you have checked the answer first of cor-el solve your problem, I have not exposed on this point.

    2. the bookmarks toolbar shows, and this button is this toolbar.

    Is the Menu bar showing or not?

    Have you tried the reset bar of tools and commands that I mentioned?

  • Vista 64-bit now I changed my OS 32-bit now my web cam does not work, tried to get the drivers from dell but did not help

    of the vista 64-bit now, I changed my OS to Vista 32 bit , now my web cam does not work, tried to get the drivers from dell, but they are not available there. My laptop is studio-1537... Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    Ideas:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Hello

    I check your firewall settings to see if it can cause a conflict with the season chat software.

    Chris
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Hi, I have CC on my desktop computer. Yesterday I connected my laptop and tried to download PremierePro on it. I had only 30 months trial version. What should I do to get the CC version?

    Hi, I have CC on my desktop computer. Yesterday I connected my laptop and tried to download PremierePro on it. I had only 30 months trial version. What should I do to get the CC version?

    Hello

    Please see the below help documents:

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Solutions to connection errors, activation and connection with creative Cloud applications and Creative Suite

    Kind regards

    Sheena

  • Hi, I'm only following a Web Design course and tried to get the student cloud version. Also, I got a letter from my college. My college is in Toronto, Ontario, Canada. I am unable to cnoact any customer service Adobe Canada. Any information will be gr

    Hi, I'm only following a Web Design course and tried to get the student cloud version.

    Also, I got a letter from my college. My college is in Toronto, Ontario, Canada. I am unable to communicate with any service the customer from Adobe Canada.

    Any information will be greatly appreciated.

    Best regards

    Sami.

    Hello

    Please try to reach out to support call/chat.

    Contact the customer service

    * Be sure to stay connected with your Adobe ID before accessing the link above *.

    Kind regards

    Sheena

  • My pdf reezes when I click on COMMENT. I'm trying to get the tools to edit a pdf file. If I use the tools on the toolbar, there is no problem, but as soon as I click on the COMMENT, the document hangs and I have to open the Task Manager to plant it. It st

    Sorry, I'm new to the type of problem-solving process, and I don't know how to change my first speech. My true statement is less to:

    My pdf freezes when I click on COMMENT. I'm trying to get the tools to edit a pdf file. If I use the tools on the toolbar, there is no problem, but as soon as I click on the COMMENT, the document hangs and I have to open the Task Manager to plant it. It started in the last seven days (3.31.15).

    I responded to your questions below, BUT while I was looking for properties, I found repair service REPAIR the INSTALLATION of ACROBAT, and (this is) the issue has been resolved!

    Thanks for making me look for information.

    Karen

    I use Acrobat Pro XI, version 11.0.10.32.

    I created the file, that I worked in during the freeze, so I tried a PDF I created with Adobe and it also freezes when I click on COMMENT. I discover that the OBSERVATIONS of the plug-in is loaded. (See image

    I used the REVIEW for years without this problem occurring. He started in the last 2 weeks.

    I could not find real estate under the file menu, but found a security setting in the preferences in the Edit menu. It doesn't have a way to allow/disallow COMMENT.

  • I am trying to download the new version of CC programs on my computer, but somehow get older versions

    I am trying to download the latest version of for example Illustrator (October 2014, including libraries of creative cloud, Lady with sunglasses version) on my computer, but somehow, I still get the old version of (no libraries, version of Lion). Do I did wrong? I have tried a new download of the creative cloud, removed all apps and tried a new Illustrator... still the "old" version

    Jeff, I thought that maybe my keychain on my iMac opportunity (I don't have the password) was the problem, then this afternoon I had a Mac Helpdesker synchonization on my desk to help me get rid of this problem. His advice: try a new user to test on your computer to see what makes the cloud to create Adobe. It was still the 'old' version po Illustrator. His advice: re - install your computer... that's what I did and now I have a brand new OS X Yosemite, trousseau AND the new version of Adobe CC and all programs, I want to use. Good thing is that I have 2 weeks of Christmas vacation (I'm a Professor of design)...

Maybe you are looking for

  • Satellite P850 - 12Z USB 3.0 Ports right side do not work USB 3.0 speed

    Hi all I bought a portable Satellite P850-12Z with * 4 * USB 3.0 ports. Two ports on the left side and two ports on the right side with sleep functions and fresh. If I connect an external drive Verbatim USB 3.0 ports on the left side, everything work

  • y500p, remote control issues

    the title suggests, my lenovo y500p VOLUME remote control does not work, specifically the volume and the mute button, the play, the buttons fast forward etc. etc. also does not work with wmp or wmc. The problem is that he actually used to work. Pleas

  • Acer 10 switch wireless stops after unlock

    I have an Acer Aspire SW5 - 012 (switch 10.1 Acer) with Windows 8.1A Wi - fi connection stops after the release of the device very often. To restart the wi - fi adapter.I tried to install the latest drivers for wi - fi card, restore the system to the

  • Update the bios of the DELL laptop under ubuntu

    Hi all. I have a dell inspiron N411Z (or N14z). I installed portable ubuntu 12.04 as a single operating system on the computer. Current kernel is 3.2.0 - 30, gnome 3.4.2. Are the details of my BIOS: A02 19/10/2011 I opened a session in the DELL suppo

  • Subject microsoft serial ballpoint

    Windows7 had been installed in the computer. I installed a software that can communicate with a type of Panel via the RS232 port.  The problem is that after connecting the Panel with my computer. Windows7 recognizes "Miscrosoft Seraglio roll-on. This