久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='iLiGA'></bdo><ul id='iLiGA'></ul>

<i id='iLiGA'><tr id='iLiGA'><dt id='iLiGA'><q id='iLiGA'><span id='iLiGA'><b id='iLiGA'><form id='iLiGA'><ins id='iLiGA'></ins><ul id='iLiGA'></ul><sub id='iLiGA'></sub></form><legend id='iLiGA'></legend><bdo id='iLiGA'><pre id='iLiGA'><center id='iLiGA'></center></pre></bdo></b><th id='iLiGA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='iLiGA'><tfoot id='iLiGA'></tfoot><dl id='iLiGA'><fieldset id='iLiGA'></fieldset></dl></div>

      <small id='iLiGA'></small><noframes id='iLiGA'>

    1. <tfoot id='iLiGA'></tfoot>
        <legend id='iLiGA'><style id='iLiGA'><dir id='iLiGA'><q id='iLiGA'></q></dir></style></legend>

        如何選擇SQL數據庫表中的第n行?

        How to select the nth row in a SQL database table?(如何選擇SQL數據庫表中的第n行?)

                <legend id='klQoV'><style id='klQoV'><dir id='klQoV'><q id='klQoV'></q></dir></style></legend><tfoot id='klQoV'></tfoot>
                <i id='klQoV'><tr id='klQoV'><dt id='klQoV'><q id='klQoV'><span id='klQoV'><b id='klQoV'><form id='klQoV'><ins id='klQoV'></ins><ul id='klQoV'></ul><sub id='klQoV'></sub></form><legend id='klQoV'></legend><bdo id='klQoV'><pre id='klQoV'><center id='klQoV'></center></pre></bdo></b><th id='klQoV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='klQoV'><tfoot id='klQoV'></tfoot><dl id='klQoV'><fieldset id='klQoV'></fieldset></dl></div>

                  <tbody id='klQoV'></tbody>
                • <bdo id='klQoV'></bdo><ul id='klQoV'></ul>
                • <small id='klQoV'></small><noframes id='klQoV'>

                  本文介紹了如何選擇SQL數據庫表中的第n行?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有興趣學習一些(理想情況下)數據庫不可知的從數據庫表中選擇n行的方法.看看如何使用以下數據庫的本機功能來實現這一點也很有趣:

                  I'm interested in learning some (ideally) database agnostic ways of selecting the nth row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases:

                  • SQL Server
                  • MySQL
                  • PostgreSQL
                  • SQLite
                  • 甲骨文

                  我目前正在 SQL Server 2005 中做類似以下的事情,但我有興趣看到其他人更不可知的方法:

                  I am currently doing something like the following in SQL Server 2005, but I'd be interested in seeing other's more agnostic approaches:

                  WITH Ordered AS (
                  SELECT ROW_NUMBER() OVER (ORDER BY OrderID) AS RowNumber, OrderID, OrderDate
                  FROM Orders)
                  SELECT *
                  FROM Ordered
                  WHERE RowNumber = 1000000
                  

                  上述 SQL 的功勞:Firoz Ansari 的博客

                  Credit for the above SQL: Firoz Ansari's Weblog

                  更新:見Troels Arvin's answer 關于 SQL 標準.Troels,你有任何我們可以引用的鏈接嗎?

                  Update: See Troels Arvin's answer regarding the SQL standard. Troels, have you got any links we can cite?

                  推薦答案

                  在標準的可選部分中有一些方法可以做到這一點,但很多數據庫都支持自己的方法.

                  There are ways of doing this in optional parts of the standard, but a lot of databases support their own way of doing it.

                  一個非常好的討論這個和其他事情的網站是 http://troels.arvin.dk/db/rdbms/#select-limit.

                  A really good site that talks about this and other things is http://troels.arvin.dk/db/rdbms/#select-limit.

                  基本上,PostgreSQL 和 MySQL 都支持非標準的:

                  Basically, PostgreSQL and MySQL supports the non-standard:

                  SELECT...
                  LIMIT y OFFSET x 
                  

                  Oracle、DB2 和 MSSQL 支持標準的窗口函數:

                  Oracle, DB2 and MSSQL supports the standard windowing functions:

                  SELECT * FROM (
                    SELECT
                      ROW_NUMBER() OVER (ORDER BY key ASC) AS rownumber,
                      columns
                    FROM tablename
                  ) AS foo
                  WHERE rownumber <= n
                  

                  (我只是從上面鏈接的站點復制的,因為我從未使用過這些數據庫)

                  (which I just copied from the site linked above since I never use those DBs)

                  更新:從 PostgreSQL 8.4 開始支持標準的窗口函數,所以希望第二個示例也適用于 PostgreSQL.

                  Update: As of PostgreSQL 8.4 the standard windowing functions are supported, so expect the second example to work for PostgreSQL as well.

                  更新: SQLite 在 2018 年 9 月 15 日的 3.25.0 版本中添加了窗口函數支持,因此這兩種形式都可以在 SQLite 中使用.

                  Update: SQLite added window functions support in version 3.25.0 on 2018-09-15 so both forms also work in SQLite.

                  這篇關于如何選擇SQL數據庫表中的第n行?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                    <tfoot id='UucPm'></tfoot>
                  • <small id='UucPm'></small><noframes id='UucPm'>

                            <tbody id='UucPm'></tbody>
                          <legend id='UucPm'><style id='UucPm'><dir id='UucPm'><q id='UucPm'></q></dir></style></legend>

                          <i id='UucPm'><tr id='UucPm'><dt id='UucPm'><q id='UucPm'><span id='UucPm'><b id='UucPm'><form id='UucPm'><ins id='UucPm'></ins><ul id='UucPm'></ul><sub id='UucPm'></sub></form><legend id='UucPm'></legend><bdo id='UucPm'><pre id='UucPm'><center id='UucPm'></center></pre></bdo></b><th id='UucPm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UucPm'><tfoot id='UucPm'></tfoot><dl id='UucPm'><fieldset id='UucPm'></fieldset></dl></div>
                            <bdo id='UucPm'></bdo><ul id='UucPm'></ul>

                            主站蜘蛛池模板: 欧美精品久久久久 | 亚洲一区二区三区免费在线观看 | 午夜精品影院 | 国产综合第一页 | 国产精品激情小视频 | 一区在线播放 | 最新日韩欧美 | 99热视 | 国产精品久久 | h片在线看 | 99久久成人 | 免费一二区| 国产精品视频一区二区三区 | 欧美一区二区三区在线视频 | 亚洲xx在线 | 久久综合久色欧美综合狠狠 | 欧美成人黄色小说 | 国产午夜精品久久久久免费视高清 | 手机av在线 | 色婷婷精品久久二区二区蜜臂av | re久久| 一区二区三区在线免费看 | 久久久久久综合 | 国产精品亚洲一区二区三区在线观看 | 在线观看中文视频 | 久久精品免费一区二区 | 久久偷人| 精品国产一区三区 | 一区二区三区四区免费在线观看 | 91视频亚洲 | 亚洲在线高清 | 国产精品久久久久久久久久妞妞 | 亚洲一区在线播放 | 日本网站免费在线观看 | 国产亚洲精品美女久久久久久久久久 | 日本久久网 | 精品国产青草久久久久96 | 午夜免费视频 | 久久不射电影网 | 成人免费在线视频 | 亚洲成人一级 |