<tfoot id='5VZSH'></tfoot>

      <legend id='5VZSH'><style id='5VZSH'><dir id='5VZSH'><q id='5VZSH'></q></dir></style></legend>

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

        <bdo id='5VZSH'></bdo><ul id='5VZSH'></ul>
    2. <small id='5VZSH'></small><noframes id='5VZSH'>

        使用 SQL 生成日期范围

        Generate a range of dates using SQL(使用 SQL 生成日期范围)
      1. <tfoot id='zpgS8'></tfoot>

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

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

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

                    <tbody id='zpgS8'></tbody>
                  本文介绍了使用 SQL 生成日期范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 SQL 查询,它接受一个日期参数(如果我要将它放入一个函数中),我需要在去年的每一天运行它.

                  I have a SQL query that takes a date parameter (if I were to throw it into a function) and I need to run it on every day of the last year.

                  如何生成过去 365 天的列表,以便我可以使用直接 SQL 来执行此操作?

                  How to generate a list of the last 365 days, so I can use straight-up SQL to do this?

                  显然生成一个列表 0..364 也可以,因为我总是可以:

                  Obviously generating a list 0..364 would work, too, since I could always:

                  SELECT SYSDATE - val FROM (...);
                  

                  推荐答案

                  无需使用超大表或 ALL_OBJECTS 表:

                  There's no need to use extra large tables or ALL_OBJECTS table:

                  SELECT TRUNC (SYSDATE - ROWNUM) dt
                    FROM DUAL CONNECT BY ROWNUM < 366
                  

                  会解决问题.

                  这篇关于使用 SQL 生成日期范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM(Oracle PL/SQL - 使用自定义 SQLERRM 引发用户定义的异常)
                  Oracle: is there a tool to trace queries, like Profiler for sql server?(Oracle:是否有跟踪查询的工具,例如用于 sql server 的 Profiler?)
                  SELECT INTO using Oracle(使用 Oracle SELECT INTO)
                  How to handle Day Light Saving in Oracle database(如何在 Oracle 数据库中处理夏令时)
                  PL/SQL - Use quot;Listquot; Variable in Where In Clause(PL/SQL - 使用“列表Where In 子句中的变量)
                  Oracle: Import CSV file(Oracle:导入 CSV 文件)
                    • <tfoot id='PaUGu'></tfoot>
                          <tbody id='PaUGu'></tbody>
                          • <bdo id='PaUGu'></bdo><ul id='PaUGu'></ul>
                            <i id='PaUGu'><tr id='PaUGu'><dt id='PaUGu'><q id='PaUGu'><span id='PaUGu'><b id='PaUGu'><form id='PaUGu'><ins id='PaUGu'></ins><ul id='PaUGu'></ul><sub id='PaUGu'></sub></form><legend id='PaUGu'></legend><bdo id='PaUGu'><pre id='PaUGu'><center id='PaUGu'></center></pre></bdo></b><th id='PaUGu'></th></span></q></dt></tr></i><div id='PaUGu'><tfoot id='PaUGu'></tfoot><dl id='PaUGu'><fieldset id='PaUGu'></fieldset></dl></div>

                            <legend id='PaUGu'><style id='PaUGu'><dir id='PaUGu'><q id='PaUGu'></q></dir></style></legend>

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