JDCam
asked on
SQL Select unique records with max date for Oracle10g
Experts,
I am stumped on a SQL select query against an Oracle 10g database.
I need to select every unique combination of CUST and ITEM. Where there is more than one, I need the most recent date returned. I put an asterix on the desired results. The date is a proper system date and sorts properly in a query.
Cust Item Date (YY-MM-DD)
A COOKIE 11-09-15 *
A COOKIE 10-06-24
A COOKIE 98-07-21
A PIZZA 08-02-15 *
A DONUT 10-02-21 *
B PIZZA 11-05-03 *
B PIZZA 08-12-31
B PIZZA 06-06-07
B DONUT 10-11-05 *
C DONUT 99-02-03 *
C PIZZA 03-04-18 *
I am stumped on a SQL select query against an Oracle 10g database.
I need to select every unique combination of CUST and ITEM. Where there is more than one, I need the most recent date returned. I put an asterix on the desired results. The date is a proper system date and sorts properly in a query.
Cust Item Date (YY-MM-DD)
A COOKIE 11-09-15 *
A COOKIE 10-06-24
A COOKIE 98-07-21
A PIZZA 08-02-15 *
A DONUT 10-02-21 *
B PIZZA 11-05-03 *
B PIZZA 08-12-31
B PIZZA 06-06-07
B DONUT 10-11-05 *
C DONUT 99-02-03 *
C PIZZA 03-04-18 *
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help.
ASKER