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

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

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

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

        Sqlite 将字符串转换为日期

        Sqlite convert string to date(Sqlite 将字符串转换为日期)

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

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

            <bdo id='xN30I'></bdo><ul id='xN30I'></ul>
              <tbody id='xN30I'></tbody>
              • <tfoot id='xN30I'></tfoot>
                • <legend id='xN30I'><style id='xN30I'><dir id='xN30I'><q id='xN30I'></q></dir></style></legend>
                  本文介绍了Sqlite 将字符串转换为日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我将日期作为字符串存储在 sqlite 数据库中,例如28/11/2010".我想将字符串转换为日期.

                  I have date stored as string in an sqlite database like "28/11/2010". I want to convert the string to date.

                  特别是我必须在两个日期之间转换大量字符串日期.

                  Specifically I have to convert lots of string dates between two dates.

                  在 postgresql 中,我使用 to_date('30/11/2010','dd/MM/yyyy'),我如何用 sqlite 做同样的事情?

                  In postgresql, I use to_date('30/11/2010','dd/MM/yyyy'), how can I do the same thing with sqlite?

                  像这样:

                  SELECT * FROM table
                      WHERE   to_date(column,'dd/MM/yyyy')
                      BETWEEN to_date('01/11/2010','dd/MM/yyyy')
                      AND     to_date('30/11/2010','dd/MM/yyyy')
                  

                  推荐答案

                  As Sqlite 没有日期类型您将需要进行字符串比较以实现此目的.为此,您需要颠倒顺序 - 例如从 dd/MM/yyyy 到 yyyyMMdd,使用类似

                  As Sqlite doesn't have a date type you will need to do string comparison to achieve this. For that to work you need to reverse the order - eg from dd/MM/yyyy to yyyyMMdd, using something like

                  where substr(column,7)||substr(column,4,2)||substr(column,1,2) 
                        between '20101101' and '20101130'
                  

                  这篇关于Sqlite 将字符串转换为日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                  MySQL cumulative sum grouped by date(按日期分组的 MySQL 累计总和)
                  Split string into table given row delimiter and column delimiter in SQL server(在 SQL Server 中将字符串拆分为给定行分隔符和列分隔符的表)
                  Split String by delimiter position using oracle SQL(使用 oracle SQL 按分隔符位置拆分字符串)
                  Split string by space and character as delimiter in Oracle with regexp_substr(使用 regexp_substr 在 Oracle 中按空格和字符作为分隔符拆分字符串)

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

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

                  • <legend id='ekItr'><style id='ekItr'><dir id='ekItr'><q id='ekItr'></q></dir></style></legend>
                      <tbody id='ekItr'></tbody>

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

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