乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      四種方法取表里n到m條紀(jì)錄-地主寶寶

       ShangShujie 2007-05-02

      --------------------四種方法取表里n到m條紀(jì)錄: -------------------------

      1.
      select top m * into 臨時表(或表變量) from tablename order by columnname -- 將top m筆插入
      set rowcount n
      select * from 表變量 order by columnname desc


      2.
      select top n * from
      (select top m * from tablename order by columnname) a
      order by columnname desc


      3.如果tablename里沒有其他identity列,那么:
      select identity(int) id0,* into #temp from tablename

      取n到m條的語句為:
      select * from #temp where id0 >=n and id0 <= m

      如果你在執(zhí)行select identity(int) id0,* into #temp from tablename這條語句的時候報錯,
      那是因?yàn)槟愕腄B中間的select into/bulkcopy屬性沒有打開要先執(zhí)行:
      exec sp_dboption 你的DB名字,‘select into/bulkcopy‘,true


      4.如果表里有identity屬性,那么簡單:
      select * from tablename where identitycol between n and



      Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=660203

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多