select col1,col2,col3 from tab1 where name='123'
union all
select col1,col2,col3 from tab2 where name='123'
union all
select col1,col2,col3 from tab3 where name='123'
union all
select col1,col2,col3 from tab2 where name='123'
union all
select col1,col2,col3 from tab3 where name='123'
select * from
tab1 a,tab2 b,tab3 c
where a.name = b.name and a.name = c.name and a.name = '123'联合查询:
select * from tab1 where name = '123'
union all
select * from tab2 where name = '123'
union all
select * from tab3 where name = '123'
现在只能猜测你的意思是不是
select * from table1 a,table2 b,table3 c
where a.name=b.name and a.name=c.name
where a.name=b.name and a.name=c.name
and a.name='123'
inner join table3 on(table1.name=table3.name) where table1.name='123'