Debit and credit match query

Hı,

ID DEBIT CREDIT


1 1000 --------
2 ---- 500
3 ---- 200
4 ---- 100
5 ---- 500

I want to this result but dont cursor

ID_DEBIT ID_CREDIT AMOUNT


1 2 500
1 3 200
1 4 100
1 5 200
--- 5 300

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

Hi

Please explain what you want "clearly"

image

Hi

Sorry

I am able to see the data
Please explain what you are looking for

Example
Data
1 100 a
2 200 b

I want to add
1 + 200 then
200 - 2
equals

Some thing Like this

Looking at the data
no idea what you want to do

If i understand what you are wanting
how the data should be manipulated
to get the final output

I can work on the SQL to get the desired result