Debit and credit match query

select isnull(d.id_debit, '---'),  isnull(c.id_credit, '---'), d.amount
from debit d
full join credit c
on d.amount = c.amount