select * FROM 表 WHERE date>=20100101 and time>"12:00" ORDER BY date asc,time asc limit 1 
select * FROM 表2 WHERE date>=20100101 and time>"12:00" ORDER BY date asc,time asc limit 1
在查询1 后面连着查询2要怎么写?意思就是 select * FROM 表 WHERE date>=20100101 and time>"12:00" ORDER BY date asc,time asc limit 1 
and
select * FROM 表2 WHERE date>=20100101 and time>"12:00" ORDER BY date asc,time asc limit 1同时显示出这两条语句的查询结果

解决方案 »

  1.   

    select * from (select * FROM 表    WHERE date>="20100101" and time>"12:00" ORDER BY date asc,time asc limit 1 ) as t
    union all 
    select * from (select * FROM `表2` WHERE date>="20100101" and time>"12:00" ORDER BY date asc,time asc limit 1)as t;
      

  2.   

    用这样试试,上面括号有个全角
    select * from (select * FROM `表` WHERE date>="20100101" and time>"12:00" ORDER BY date asc,time asc limit 1) as t
    union all 
    select * from (select * FROM `表2` WHERE date>="20100101" and time>"12:00" ORDER BY date asc,time asc limit 1) as t;