How to sum a value in a grouped set of results? SQL Server
Try something like this:

Select debit_id, transfer_id, sum(amount) as "Amount_Sum"
from Transfer_debits
where transfer_id = 861288
group by  debit_id, transfer_id


For the debit_type, if you want a different sum depending on its value, just add it to the select and the group by.