我有 2 张桌子
table 1 table 2
------------------ ----------------------
description paidamt description recievedamt
ele. bill 200 donation 1000
stationary 500 fees 200
salary 1000
我想要以下格式的结果(数据将根据日期排序)
description debit credit
---------------------------
ele. bill 200
donation 1000
stationary 500
fees 200
salary 1000
问题是,当我将 amt 设置为借方时,我无法将贷方列设置为空白,或者当我将 amt 设置为特定列的贷方时,我无法将借方列设置为空白。我正在处理以下查询....
WHEN Payment_Voucher_Master.grand_tot <> '0'
THEN ''
ELSE 'dgf'
END credit
FROM Receipt_Voucher_Master,Payment_Voucher_Master
GROUP BY Payment_Voucher_Master.PaidTo,Payment_Voucher_Master.grand_tot
SELECT Receipt_Voucher_Master.PaidTo
AS description, Receipt_Voucher_Master.grand_total as credit,
CASE
WHEN Receipt_Voucher_Master.grand_total <> '0'
THEN ''
ELSE 'dgf'
END debit
FROM Receipt_Voucher_Master,Payment_Voucher_Master
GROUP BY Receipt_Voucher_Master.PaidTo,Receipt_Voucher_Master.grand_total;
我试图加入这两个查询