Hello:
I'd like to know what should be the SQL statement (for ORACLE DBMS) that would get back unique (by CUSTOMER_ID, VEHICLE_ID, DEALER_ID and EVENT_TYPE_ID) rows BUT it will return the latest date (EVENT_INITIATED_DATE) for that row too. I've tried DISTINCT and GROUP BY, but wasn't able to figure out how to handle EVENT_INITIATED_DATE (that is DATE data type).
CUSTOMER_ID VEHICLE_ID DEALER_ID EVENT_TYPE_ID EVENT_INITIATED_DATE
---------------------- ---------------------- ---------- ---------------------- -------------------------
22197630 23093399 6040 20 11-JAN-07
22197630 23093399 6040 5 11-JAN-07
22197630 23093399 6040 4 11-JAN-07
22197630 23093399 6040 3 11-JAN-07
22197630 23093399 6040 4 19-JAN-06