I am new to using sql .i have two table expense statement and revenue statement such as
revenue statement
accountname debit
A 100
B 200
expense statemnt
accountname credit
X 300
Y 400
is there anyway i can join these two table like this, if so can someome tell me how to do it please.
accountname debit credit
A 100
B 200
X 300
Y 400
I have tried this sattement but it doesnot work
SELECT accountname, NULL AS debit, credit FROM revenue
UNION ALL
SELECT accountname, debit, NULL FROM expense