这样:select a.* , c.* , t.* from a , c , (select * from b union all select * from b的那些历史表,如果有多个逐一union all) t where a.关键字 = b.关键字 and a.关键字 = t.关键字
列出3个表里面的字段 然后历史表和3个表实在一个库吗? 如果不是 直接关联历史表也可以举例: 在当前库运行sql--当前库 表:a,b,c 历史库L 表:his_b select a.col1,b.col2,c.col3 from a, (select col2 from b union all select col2 from L.his_b) b,c where ...
(select * from b union all select * from b的那些历史表,如果有多个逐一union all) t
where a.关键字 = b.关键字 and a.关键字 = t.关键字
select a.col1,b.col2,c.col3
from a,
(select col2 from b
union all
select col2 from L.his_b) b,c
where ...
连接操作正常进行就可以了。
from A a,
C c,
(
select b2.xx,....from B b2
union all
select b3.xx,....from B历史表 b3
) b