This code shows one way to go about it. I ran it against this data:
mydt = data table("MyDemo");
mydtsummary = Data Table( "MyDemo" ) << Summary(
Group( :SN ),
Max( :DT ),
statistics column name format( "stat of column" )
);
mydt << Update(
With( Data Table( mydtsummary) ),
Match Columns( :SN = :SN ),
Add Columns from Update table( :Max of DT )
);
mydt << select where(:DT == :Max of DT) << invert row selection;
mydt << delete rows;
mydt << delete columns("Max of DT");
close(mydtsummary, nosave);