久久久久久久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數(shù)據(jù)庫(kù)表中的第n行?

        How to select the nth row in a SQL database table?(如何選擇SQL數(shù)據(jù)庫(kù)表中的第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數(shù)據(jù)庫(kù)表中的第n行?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有興趣學(xué)習(xí)一些(理想情況下)數(shù)據(jù)庫(kù)不可知的從數(shù)據(jù)庫(kù)表中選擇n行的方法.看看如何使用以下數(shù)據(jù)庫(kù)的本機(jī)功能來實(shí)現(xiàn)這一點(diǎ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 關(guān)于 SQL 標(biāo)準(zhǔn).Troels,你有任何我們可以引用的鏈接嗎?

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

                  推薦答案

                  在標(biāo)準(zhǔn)的可選部分中有一些方法可以做到這一點(diǎn),但很多數(shù)據(jù)庫(kù)都支持自己的方法.

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

                  一個(gè)非常好的討論這個(gè)和其他事情的網(wǎng)站是 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 都支持非標(biāo)準(zhǔn)的:

                  Basically, PostgreSQL and MySQL supports the non-standard:

                  SELECT...
                  LIMIT y OFFSET x 
                  

                  Oracle、DB2 和 MSSQL 支持標(biāo)準(zhǔn)的窗口函數(shù):

                  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
                  

                  (我只是從上面鏈接的站點(diǎn)復(fù)制的,因?yàn)槲覐奈词褂眠^這些數(shù)據(jù)庫(kù))

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

                  更新:從 PostgreSQL 8.4 開始支持標(biāo)準(zhǔn)的窗口函數(shù),所以希望第二個(gè)示例也適用于 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 版本中添加了窗口函數(shù)支持,因此這兩種形式都可以在 SQLite 中使用.

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

                  這篇關(guān)于如何選擇SQL數(shù)據(jù)庫(kù)表中的第n行?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                            主站蜘蛛池模板: 免费理论片| 91片黄在线观看动漫 | 全部免费毛片在线播放高潮 | 亚洲成人福利 | 午夜你懂的 | 一级特黄aaaaaa大片 | 日韩精品影视 | 97色综合 | 91麻豆精品一区二区三区 | 黄色免费一级片 | 欧美精品一区二 | 小镇姑娘国语版在线观看免费 | 亚洲欧美在线播放 | 国产午夜视频在线观看 | 一区二区三区国产视频 | 中文字幕在线观看不卡 | 欧美成人极品 | 国产欧美日韩在线观看 | 中文字幕亚洲欧美 | 亚洲日本精品 | 国产日韩欧美在线 | 丁香婷婷在线 | 99这里有精品 | 免费91网站| 欧美69式性猛交 | 黄色大毛片 | 欧美 日韩 国产 在线 | 在线看av网址| 亚洲午夜精品 | 肉丝美脚视频一区二区 | 色偷偷噜噜噜亚洲男人 | 久久免费高清视频 | 久久日本| 91精品麻豆 | 一级做a爱片性色毛片 | 九九九久久久 | www.九九热 | 一区二区三区在线看 | 亚洲久久久久久 | 亚洲黄色免费 | 精品天堂 |