query - max date - group by
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)
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)
0