我有下边一段code:
select a.*, b.*, c.*, d.*, e.*, f.* from a,b, c left join d on c.idc=d.idd
left join e on c.idc=e.ide
left join f on c.idc=f.idf
where a.id=b.idb and a.id=c.idc
现在我有一个基准文件t,需要使用left join把上边的代码生成的数据合到t这个基准文件上。我能用下边这段代码吗?如果里边有错,能给改改、讲讲吗?谢谢。
select t.* from t left join (把上面的code拷贝下来:
select a.*, b.*, c.*, d.*, e.* from a,b, c left join d on c.idc=d.idd
left join e on c.idc=e.ide
left join f on c.idc=f.idf
where a.id=b.idb and a.id=c.idc) all on t.idt = all.id