Monday, March 26, 2012

Help on query

I have two tables Income(Date, IncomeType, Amount) and Expense(Date, ExpenseType, Amount). I want to create a balance sheet report for which need a query or view which creates a virtual table of form BalanceSheet(IncomeType, IncomeAmount, ExpenseType, ExpenseAmount). The table should look like:

Salary 100000 Rent a Car 5000
(null) (null) Tution 1000
...................................... ...
...................................... ...

How can it be done?

Appreciate for the help.

Rajuselect income, amount, '','' from incomes
union
select '','',expense, amount from expenses

No comments:

Post a Comment