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

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

        小于或等于 Oracle SQL

        时间:2023-11-28
      2. <i id='nOuwN'><tr id='nOuwN'><dt id='nOuwN'><q id='nOuwN'><span id='nOuwN'><b id='nOuwN'><form id='nOuwN'><ins id='nOuwN'></ins><ul id='nOuwN'></ul><sub id='nOuwN'></sub></form><legend id='nOuwN'></legend><bdo id='nOuwN'><pre id='nOuwN'><center id='nOuwN'></center></pre></bdo></b><th id='nOuwN'></th></span></q></dt></tr></i><div id='nOuwN'><tfoot id='nOuwN'></tfoot><dl id='nOuwN'><fieldset id='nOuwN'></fieldset></dl></div>

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

              <tbody id='nOuwN'></tbody>

              • <bdo id='nOuwN'></bdo><ul id='nOuwN'></ul>
                <tfoot id='nOuwN'></tfoot>
                  <legend id='nOuwN'><style id='nOuwN'><dir id='nOuwN'><q id='nOuwN'></q></dir></style></legend>
                  本文介绍了小于或等于 Oracle SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  updated_date  = 08-Jun-2010;
                  

                  我有一个这样的查询

                  select * from asd whre updated_date <= todate('08-Jun-2010', 'dd-MM-yy');
                  

                  但我没有得到任何结果.它仅适用于 todate 是 09-Jun-2010...

                  but I am not getting any results. it only works if todate is 09-Jun-2010...

                  即我的 equalto 操作符工作不正常.

                  i.e. my equalto operator is not working properly.

                  为什么会这样?

                  推荐答案

                  在 Oracle 中,DATE 是一个时间点.它总是有一个精确到秒的时间分量.todate('08-Jun-2010', 'dd-Mon-yyyy') 在 Oracle 中与 todate('08-Jun-2010 00:00:00', 'dd-Mon-yyyy hh24:mi:ss').因此,如果您选择截至该日期的行,您将不会在当天获得任何时间分量不等于 00:00 的行.

                  In Oracle a DATE is a point in time. It always has a time component with a precision to the second. todate('08-Jun-2010', 'dd-Mon-yyyy') is in Oracle the same as todate('08-Jun-2010 00:00:00', 'dd-Mon-yyyy hh24:mi:ss'). So if you select rows up to that date you won't get any row on that day with a time component not equal to 00:00.

                  如果您想选择直到并包括 08-JUN-2010 的所有行,我建议使用:

                  If you want to select all the rows up to and including 08-JUN-2010, I would suggest using:

                  < to_date('09-06-2010', 'dd-MM-yyyy')
                  

                  <= to_date('08-06-2010 23:59:59', 'dd-MM-yyyy hh24:mi:ss')
                  

                  注意 - 我更正了您的日期格式:如果您想使用缩写的月份名称,则需要使用 MON.我建议改用 MM,这样当有人更改其客户端设置 (NLS_DATE_LANGUAGE) 时,您就不会出错.也更喜欢使用 YYYY 而不是 YY.

                  Note - I corrected your date format: you need to use MON if you want to use the abbreviated month name. I would suggest using MM instead, so that you won't get error when someone changes its client settings (NLS_DATE_LANGUAGE). Also prefer the use of YYYY instead of YY.

                  这篇关于小于或等于 Oracle SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:PL/SQL 查询 IN 逗号分隔的字符串 下一篇:在 PL/SQL 中打印记录字段

                  相关文章

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

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

                    <tfoot id='BGP60'></tfoot>
                      <bdo id='BGP60'></bdo><ul id='BGP60'></ul>