SQL Language (MOSC)

MOSC Banner

query - max date - group by

edited Nov 12, 2013 5:42AM in SQL Language (MOSC) 6 commentsAnswered ✓
Oracle DB version 11.2
       
Data type
Delivery Date =  Timestamp   
APP_ID   =   VARCHAR2

I need to write a sql query that will bring the appl_id and delivery_date. It must display the unique application ID and Max Delivery date for that date.

for ABC123 - result should be:
APPL_ID    Delivery Date
ABC123    11/1/13 2:00 PM
ABC123    11/4/13 2:00 PM

Example Table:
APPL_ID    Delivery Date   
ABC123    11/1/13 5:00 AM   
ABC123    11/1/13 4:00 AM   
ABC123    11/1/13 2:00 PM    (max date)
ABC123    11/1/13 6:00 AM   
ABC123    11/4/13 4:00 AM   
ABC123    11/4/13 2:00 PM    (max date)
       
BBB456    11/2/13 6:00 AM    (max date)
BBB456    11/2/13 4:00 AM   
BBB456    11/3/13 2:00 PM    (max date)
BBB456    11/3/13 6:00 AM   
BBB456    11/4/13 4:00 AM    (max date)
BBB456    11/4/13 2:00 AM   
       
CCC789    11/2/13 3:00 AM   
CCC789    11/2/13 7:00 AM    (max date)

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center