日期:2014-05-18 浏览次数:20692 次
select t.id, t3.name from table_list t inner join ( select id, name from table1 union all select id, name from table2) t3 on t.id=t3.id
------解决方案--------------------
如果还有的表与前两表并列,继续 union
引用一楼代码:
select t.id, t3.name from table_list t inner join ( select id, name from table1 union all select id, name from table2 on t.id=t3.id union all select id,name from table3 .... ) t3
------解决方案--------------------