• <bdo id='DDDH9'></bdo><ul id='DDDH9'></ul>

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

    1. <i id='DDDH9'><tr id='DDDH9'><dt id='DDDH9'><q id='DDDH9'><span id='DDDH9'><b id='DDDH9'><form id='DDDH9'><ins id='DDDH9'></ins><ul id='DDDH9'></ul><sub id='DDDH9'></sub></form><legend id='DDDH9'></legend><bdo id='DDDH9'><pre id='DDDH9'><center id='DDDH9'></center></pre></bdo></b><th id='DDDH9'></th></span></q></dt></tr></i><div id='DDDH9'><tfoot id='DDDH9'></tfoot><dl id='DDDH9'><fieldset id='DDDH9'></fieldset></dl></div>

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

        AS400/DB2 中的分页查询(SQL)

        Pagination query(SQL) in AS400/DB2(AS400/DB2 中的分页查询(SQL))
            <tbody id='3CY6T'></tbody>

            <small id='3CY6T'></small><noframes id='3CY6T'>

          1. <tfoot id='3CY6T'></tfoot>
              <bdo id='3CY6T'></bdo><ul id='3CY6T'></ul>

                <i id='3CY6T'><tr id='3CY6T'><dt id='3CY6T'><q id='3CY6T'><span id='3CY6T'><b id='3CY6T'><form id='3CY6T'><ins id='3CY6T'></ins><ul id='3CY6T'></ul><sub id='3CY6T'></sub></form><legend id='3CY6T'></legend><bdo id='3CY6T'><pre id='3CY6T'><center id='3CY6T'></center></pre></bdo></b><th id='3CY6T'></th></span></q></dt></tr></i><div id='3CY6T'><tfoot id='3CY6T'></tfoot><dl id='3CY6T'><fieldset id='3CY6T'></fieldset></dl></div>
              • <legend id='3CY6T'><style id='3CY6T'><dir id='3CY6T'><q id='3CY6T'></q></dir></style></legend>

                  本文介绍了AS400/DB2 中的分页查询(SQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在努力尝试为我们的表格创建基于 web 的 php 分页其中有超过一百万行.

                  I have been working on try to create php web-based paging for our tables which have over a million rows.

                  根据我的阅读,我有 3 个选项

                  Based on what I have read, I have 3 options

                  1. 检索结果集中的所有行 - 对我来说不可能,因为它的大小
                  2. 检索 1000 行,存储在临时表中并为它并通过它翻页 - 查询太多 - 插入太多!!
                  3. 如果有人选择向前或向后翻页,则每次运行查询

                  现在我正在尝试使选项 3 起作用.我的第一页显示为"select * from accout order by acct 仅获取前 10 行"下一页"select * from account where acct>(last record) order by acct fetch仅限前10名"最后一页记录"select * from account where acct=(select max(acct) from account)"

                  Right now I am trying to get option 3 working. I have the first page showing up as "select * from accout order by acct fetch first 10 rows only" Page next "select * from account where acct>(last record) order by acct fetch first 10 only" page last record "select * from account where acct=(select max(acct) from account)"

                  问题是显示上一页,我真的很感激在这方面提供帮助.

                  The problem is showing the previous page and i really would appreciate help in this.

                  推荐答案

                  SELECT *
                    FROM (
                      SELECT 
                        *, 
                        ROW_NUMBER() OVER (ORDER BY acct) AS RowNum
                      FROM 
                        account
                    ) AS Data
                  WHERE 
                    RowNum BETWEEN 100 AND 110;
                  

                  首先,您应该去掉 SELECT *.只选择您需要的字段.

                  First, you should get rid of the SELECT *. Select only the fields you need.

                  acct 上放置一个索引,这将有助于 ROW_NUMBER() OVER (ORDER BY acct) 构造.

                  Place an index on acct, this will help the ROW_NUMBER() OVER (ORDER BY acct) construct.

                  使用 SELECT COUNT(*) FROM account 来确定您将拥有多少页.

                  Use a SELECT COUNT(*) FROM account to determine how many pages you will have.

                  另请阅读 最快/最有效的方式使用 SQL 搜索 DB2 进行分页

                  这篇关于AS400/DB2 中的分页查询(SQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                      <tbody id='HdEBi'></tbody>

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

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

                        1. <tfoot id='HdEBi'></tfoot>