I am using the following sql statement to sum values from two columns from two different tables. The statement can output but not the desired result.
SELECT
This should do it:
select income, expense, income-expense balance from (select sum(rate) income from _income) i JOIN (select sum(rate) expense from _expense) e