DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: How can I get result that the date is the max date of a group?

  1. #1
    Join Date
    Aug 2002
    Posts
    18

    Question How can I get result that the date is the max date of a group?

    Hello,

    I have a SQL question:

    Table: A,
    HAS COLUMNS: CASEID, ASSESSID, FUNCTION, DATE

    I need to create a SQL that returns all the rows that date match the max date of each case.

    Thanks in advance!:

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Read SQL Reference for details of analytic functions.

    Code:
    Select
       caseid,
       assessid,
       function,
       date
    from
       (
       Select
          caseid,
          assessid,
          function,
          date,
          Max(date) Over (Partition By caseid)
             max_date
       From
          A
       )
    Where
       date = max_date
    /
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Aug 2002
    Posts
    18
    Thank you!
    I try to test it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width