10 Replies Latest reply: Jul 24, 2012 9:10 AM by Henco van Ee RSS

    Min / max function

    Henco van Ee

      Hi all,

       

      I think this is a question which can be solved with a min/max function, but I can't get it done. I hope one of you guys can help me out.

       

      I do have the following data:

       

      CONTACTIDACCOUNTIDDATESCHEDULED
      1015002-05-2012
      1215006-07-2012
      1515005-06-2012
      2015003-04-2012
      5016005-02-2012
      5516005-07-2012
      6516016-04-2012

       

      Now I would like to see the contactids per accountid which have the highest date. The result should be like this:

       

      CONTACTIDACCOUNTIDDATESCHEDULED
      1215006-07-2012
      5516005-07-2012

       

      As you can see, there is no logic between the contactids and the datescheduled.

       

      I am using Oracle SQL, but solutions in another way are also welcome.

       

      Regards,

      Henco