select title from tableA where title like '%123%'
union all
select title from tableB where title like '%123%'
union all
select title from tableC where title like '%123%'
union all
select title from tableD where title like '%123%'
union all
select title from tableE where title like '%123%'

解决方案 »

  1.   

    我用以下例子测试,发现nononono(null,null) 做得正确呀!
    declare @ table (a int,b char(10),c datetime,d int)
    insert @ values (1,'165','2009-01-05',4)
    insert @ values (1,'2t','2007-01-05',30)
    insert @ values (1,'35',getdate(),40)
    insert @ values (1,'46','2004-01-05',50)
    declare @1 table (e int,b char(10),f INT,g int)
    insert @1 values (1,'176',5,4)
    insert @1 values (1,'265',1,30)
    insert @1 values (1,'364',89,40)
    insert @1 values (1,'467',2004,50)select b from @ where b like '%6%'
    union all
    select b from @1 where b like '%6%'   你的表和这个有什么区别吗?为何不行呢?