Hi Forumer'sUpn checking from my table I just encounter about 362 records with duplicate entries. I just want retain 1 records of the duplicate records. kindly please help me to modify the scripts below the suit to my requirements.--DATAdeclare @tmp table(esn nvarchar(35), model_code nvarchar(35), supplier int, shipdate datetime)insert into @tmp values('270113179916697013','P333-4410-EVO',40,'2011-09-28 00:00:00.000')insert into @tmp values('270113179916697013','P333-4410-EVO',40,'2011-09-28 00:00:00.000')insert into @tmp values('268435456203849506','P300-1710-DROID',45,'2011-08-23 00:00:00.000')insert into @tmp values('268435456203849506','P300-1710-DROID',45,'2011-08-23 00:00:00.000')insert into @tmp values('268435456203849508','P300-1710-DROID2',42,'2011-09-20 00:00:00.000')--SCRIPTselect ESN, shipdate, COUNT(ESN) as totalfrom @tmpgroup by ESN,shipdatehaving COUNT(ESN) > 1Order by ESN
Thank you in advance..JOV