国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

Sql server 2005帶來的分頁便利

瀏覽:127日期:2023-10-30 14:09:02

select threadid from (select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads) as T where T.Pos > 100000 and T.Pos < 100030

===========================================

如果里面的這個表cs_threads數(shù)據(jù)量超大,比如,幾億條記錄,那這個方法應(yīng)該是有問題的

因為,select threadid from ( select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads ) as T where T.Pos > 100000 and T.Pos < 100030 這個語句是把select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads它全部取出來,然后在SQL的外面進行分頁的,沒在SQL2005上測試過,因為原先在ORACLE上這樣的寫法是不好的,ORACLE中這樣寫比較好:select threadid from ( select threadid, ROW_NUMBER() OVER (order by stickydate) as Pos from cs_threads a where a.pos<100030 ) as T where T.Pos > 100000

出處:blog.joycode.com/dotey/archive/2006/01/16/70493.aspx

主站蜘蛛池模板: 师宗县| 汕头市| 上饶县| 门源| 英德市| 哈巴河县| 枞阳县| 泸州市| 从化市| 松溪县| 东城区| 清水县| 中方县| 邹城市| 万源市| 镇江市| 兴城市| 焉耆| 工布江达县| 茶陵县| 依兰县| 遵化市| 汾西县| 南靖县| 木里| 迁安市| 巴南区| 扎囊县| 鹤壁市| 潜山县| 曲麻莱县| 应用必备| 佛山市| 永年县| 呼图壁县| 肇源县| 长泰县| 玉环县| 仁化县| 普安县| 泊头市|