iccsi
2012-01-17 20:06:02 UTC
I have following tables and data and would like to have a out join,
but for some reason it does not work.
table1
CalDate
1/1/2012
1/2/2012
1/3/2012
table2
ADate, MyValue
1/2/2012 1
1/3/2012 2
I want to have following result
1/1/2012 0
1/2/2012 1
1/3/2012 2
I tried to use left outer joint, right outer join and full outer join.
the result only to have 1/2/2012 and 1/3/2012 which only has table2
data.
My SQL as following
select * from table2
left outer join table1 on table1.caldate = table2.adate
select * from table2
right outer join table1 on table1.caldate = table2.adate
select * from table2
full outer join table1 on table1.caldate = table2.adate
I must have something wrong for the outer join query.
If I understand correctly, the left outer join should have all left
table records.
Your help is great appreciated,
iccsi
but for some reason it does not work.
table1
CalDate
1/1/2012
1/2/2012
1/3/2012
table2
ADate, MyValue
1/2/2012 1
1/3/2012 2
I want to have following result
1/1/2012 0
1/2/2012 1
1/3/2012 2
I tried to use left outer joint, right outer join and full outer join.
the result only to have 1/2/2012 and 1/3/2012 which only has table2
data.
My SQL as following
select * from table2
left outer join table1 on table1.caldate = table2.adate
select * from table2
right outer join table1 on table1.caldate = table2.adate
select * from table2
full outer join table1 on table1.caldate = table2.adate
I must have something wrong for the outer join query.
If I understand correctly, the left outer join should have all left
table records.
Your help is great appreciated,
iccsi