select table1.id,table3.data2
from table1,table2,table3
where table1.id=table2.id and table2.id=table3.id and table2.month=table3.month
from table1,table2,table3
where table1.id=table2.id and table2.id=table3.id and table2.month=table3.month
调试欢乐多
from table1,table2,table3
where table1.id=table2.id and table2.id=table3.id and table2.month=table3.month
没有调试,大概就是这个意思.
from table1,
left join table2 on table1.id=table2.id
left join table3 on table2.id=table3.id and table2.month=table3.month
select table1.id,table3.data2
from table1
left join table2 on table1.id=table2.id
left join table3 on table2.id=table3.id and table2.month=table3.month
具体我觉得是
select table1.id,table3.data2
from table1
left join table2 on table1.id=table2.id
right join table3 on table2.id=table3.id and table2.month=table3.month
from table1
left outer join table2 on table1.id=table2.id
right outer join table3 on table2.id=table3.id and table2.month=table3.month在 FROM 子句中指定的外联接使用以下关键字:
1.LEFT OUTER JOIN 或 LEFT JOIN
2.RIGHT OUTER JOIN 或 RIGHT JOIN
3.FULL OUTER JOIN 或 FULL JOIN