本帖最后由 yhuaqiang 于 2012-06-03 23:36:33 编辑

解决方案 »

  1.   

    select * from (
    select id,name
    from a
    union all
    select cid,title
    from b
    ) t
    where name like '%key%'
    order by id
    limit 100,10
      

  2.   

    select * from (
    select id,name 
    from a
    union all
    select cid,title 
    from b)r
    where name like '%KEY%'
    order by id
    limit 100,10;
      

  3.   

    如果两个表的数据量很大的话,这样的查询是不是效率很低?
    如果要在3个表中,就要再加一层 union all? 有没有高效点的方法