Hello Everyone,

I have a table that contains hundreds of columns with duplicate unique keys (customer ID). I would like to get rid of the duplicates by selecting the row that contains the max values in a number of columns. For each customer, I would like to keep the row that has the max value in date1, date2, date3, date4, date5,.... etc.

The tricky part is there are hundreds of dates I need to check. Is there a way to do this?


Here is a sample record:
cust_id date1 date2 date3 date4 date5 date6 date7 date8 ... date300
11111 2/2 3/3 4/4 5/5 6/6 7/7 8/8 9/9 .... 12/12
11111 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 .... 12/01

I would like to keep the first row since it has the max value in every column.


I really appreciate any input from anyone.
Thank you