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'

解决方案 »

  1.   

    关联查询:
    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'
      

  2.   

    老兄,你自己要先说的详细阿,这样的描述很模糊,应该编个小例子
    现在只能猜测你的意思是不是
    select * from table1 a,table2 b,table3 c
    where a.name=b.name and a.name=c.name
      

  3.   

    select * from table1 a,table2 b,table3 c
    where a.name=b.name and a.name=c.name
    and a.name='123'
      

  4.   

    SELECT *  from  Table1  inner join table2  on(table1.name=table2.name)
    inner join table3  on(table1.name=table3.name)  where table1.name='123'