<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 生成日期范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                    • <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'>