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

          <bdo id='MGHKE'></bdo><ul id='MGHKE'></ul>
      1. <small id='MGHKE'></small><noframes id='MGHKE'>

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

      2. 如何只选择昨天的记录?

        How can I select records ONLY from yesterday?(如何只选择昨天的记录?)
        <i id='YD11W'><tr id='YD11W'><dt id='YD11W'><q id='YD11W'><span id='YD11W'><b id='YD11W'><form id='YD11W'><ins id='YD11W'></ins><ul id='YD11W'></ul><sub id='YD11W'></sub></form><legend id='YD11W'></legend><bdo id='YD11W'><pre id='YD11W'><center id='YD11W'></center></pre></bdo></b><th id='YD11W'></th></span></q></dt></tr></i><div id='YD11W'><tfoot id='YD11W'></tfoot><dl id='YD11W'><fieldset id='YD11W'></fieldset></dl></div>
            <tbody id='YD11W'></tbody>
            <bdo id='YD11W'></bdo><ul id='YD11W'></ul>
              • <legend id='YD11W'><style id='YD11W'><dir id='YD11W'><q id='YD11W'></q></dir></style></legend>
              • <small id='YD11W'></small><noframes id='YD11W'>

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

                  本文介绍了如何只选择昨天的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我花了几个小时在网上搜索这个问题的答案......

                  I've spent hours searching the web for an answer to this question...

                  这是我目前拥有的:

                  select  *
                  from    order_header oh
                  where   tran_date = sysdate-1
                  

                  推荐答案

                  使用:

                  AND oh.tran_date BETWEEN TRUNC(SYSDATE - 1) AND TRUNC(SYSDATE) - 1/86400
                  

                  参考:TRUNC

                  tran_date 上调用函数意味着优化器将无法使用与其关联的索引(假设存在索引).某些数据库(例如 Oracle)支持基于函数的索引,这些索引允许对数据执行函数以最大程度地减少这种情况下的影响,但 IME DBA 不允许这样做.我同意 - 在这种情况下它们并不是真正必要的.

                  Calling a function on the tran_date means the optimizer won't be able to use an index (assuming one exists) associated with it. Some databases, such as Oracle, support function based indexes which allow for performing functions on the data to minimize impact in such situations, but IME DBAs won't allow these. And I agree - they aren't really necessary in this instance.

                  这篇关于如何只选择昨天的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

                      <tfoot id='JYrKk'></tfoot>
                        <tbody id='JYrKk'></tbody>

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

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

                        1. <small id='JYrKk'></small><noframes id='JYrKk'>

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