I have an income
table that looks like this:
date income
---------------------------
09/05/13 56000
09/05/13 66600
09/05/13 50000
And an expense
table that looks like this:
date expense
----------------------------
09/05/13 68800
I want to write a query whose output looks like this:
date income expense
---------------------------------------------
09/05/13 56000 68800
09/05/13 66600
09/05/13 50000
UPDATE2: If you're not concerned with particular order in which income values are matched to expense values you can get your desired output with a query like this
Output:
Here is SQLFiddle demo
UPDATE1: It seems logical to group incomes and expenses per day with a query like
Output:
Here is SQLFiddle demo
Original answer to original question: If you need a
FULL OUTER JOIN
(overdate
column) as you stated in your original question then this will do itBut then you will get this as output
Here is SQLFiddle demo