select top 10 * from A order by id union
select top 10 * from B order by id

解决方案 »

  1.   

    用union all 比用union 好。select top 10 * from A order by id 
    union all
    select top 10 * from B order by id
      

  2.   

    select top 20 from(
    select * from a 
    union all
    select * from b
    ) a order by id
      

  3.   

    select top 20 t.* from

    select * from A
    union  
    select * from B
    ) as t order by t.ID desc
      

  4.   

    Rotaxe(程序员), txlicenhe(马可) 你们有没有试过?这样的语句是不能执行的
    zjcxc(邹建), vileboy(2角变3角,苍天也会老) 请看清题目,要先各选出10个,对于大的表,这样的操作可以速度快一点