I have a table [PaymentArrangementID] int IDENTITY(1, 1) NOT NULL, [DebtorID] int NULL, [FirstPaymentDate] datetime NULL, [LastPaymentDate] datetime NULL, [NextPaymentDate] datetime NULL, [NextReviewDate] datetime NULL, [DayOfMonth] tinyint NULL, [AmountInWords] varchar(60) NULL, [AmountInFigures] money NOT NULL, [PaymentTypeID] int NULL, [ArrangementDate] datetime NULL, [CompletionDate] datetime NULL, [NumberOfPayments] int NULL, [ExpiryDate] datetime NULL, [ArrangementComplete] bit NULL, [PaymentCategory] int NULL, [PaymentFrequency] int NULL, [CreatedBy] int NULL, [CreatedOn] datetime NULL, [ModifiedBy] int NULL, [ModifiedOn] datetime NULL, [Commission] bit NOT NULL, [TimeStamp] timestamp NULL
I want to return a list of all columns where each row is the maximum (latest) arrangementdate for each debtorid. How can I do this please?