select * from ub01 where c1 = '你好'
UNION ALL
select * from ub02 where c1 = '你好'
UNION ALL
select * from ub03 where c1 = '你好'
UNION ALL
select * from ub04 where c1 = '你好'
UNION ALL
select * from ub05 where c1 = '你好'--消除重复用UNION 代替 UNION ALL

解决方案 »

  1.   

    同意楼上:
    select * from ub01 where c1 = '你好'
    UNION ALL
    select * from ub02 where c1 = '你好'
    UNION ALL
    select * from ub03 where c1 = '你好'
    UNION ALL
    select * from ub04 where c1 = '你好'
    UNION ALL
    select * from ub05 where c1 = '你好'--消除重复用UNION 代替 UNION ALL
      

  2.   

    先建立一个Viewcreate view ub
    as
    select * from ub01 
    UNION ALL
    select * from ub02
    UNION ALL
    select * from ub03
    UNION ALL
    select * from ub04
    UNION ALL
    select * from ub05
    go然后
    select * from ub where c1 = '你好'
      

  3.   

    select * into #1 from ub01 
    UNION ALL
    select * from ub02
    UNION ALL
    select * from ub03
    UNION ALL
    select * from ub04
    UNION ALL
    select * from ub05
    goselect * from #1 where c1 = '你好'
      

  4.   

    使用 UNION 运算符组合多个结果
    UNION 运算符使您得以将两个或多个 SELECT 语句的结果组合成一个结果集。使用 UNION 组合的结果集都必须具有相同的结构。而且它们的列数必须相同,并且相应的结果集列的数据类型必须兼容恰好满足你的要求啊
      

  5.   

    其实楼上已经讲完了。select * from 
    (
    select * from ub01 UNION ALL
    select * from ub02 UNION ALL
    select * from ub03 UNION ALL
    select * from ub04 UNION ALL
    select * from ub05 ) aa  where c1 = '你好'