Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Group by to delete

2817986Dec 19 2014 — edited Dec 22 2014

cust_id | date

1_1      | 26 Jan 1992

1_01    | 27 Feb 1990

2_02    | 05 Apr 2004

2_2      | 03 Apr 2004

3_03    | 05 Aug 2010

My Data should look like


cust_id | date

1_1       | 26 Jan 1992

2_02     | 05 Apr 2004

3_03     | 05 Aug 2010

Some data is duplicated in the table. I need to delete the only the rows with minimum date for each cust_id.

The problem here is, for some cust_id the '0' is prefixed after underscore  (eg: 1_1 and 1_01)

Could someone write a simple sql query to delete the duplicated cust_id with minimum date.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2015
Added on Dec 19 2014
6 comments
2,052 views