1、得到结果第100到200条的语句。
2、一张表A有3个字段a1,a2,a3,另一张B有2个字段b1,b2,想把B拷入A同时添加a3。
   即a1=b1,a2=b2,a3="xxx",一个sql语句能搞定不?
谢谢!

解决方案 »

  1.   

    select top 200 * from a where id not in (select top 100 from a)
      

  2.   

    2、一张表A有3个字段a1,a2,a3,另一张B有2个字段b1,b2,想把B拷入A同时添加a3。
       即a1=b1,a2=b2,a3="xxx",一个sql语句能搞定不?insert A(a1,a2,a3) select b1,b2,'xxx' from B
      

  3.   

    select top 100 * from (select top 200 * from tb order by id desc)a
      

  4.   

    insert into a(a1 , a2 , a3) select b1,b2,'xxx' from b
      

  5.   

    select top 100 * from (select top 200 * from tb order by id desc)a order by id asc
      

  6.   

    1,select top 100 * from (select top 200 * from tb order by id desc)a
    次序是反的,从200,199,...,101