<tfoot id='0eiJ3'></tfoot>
        <bdo id='0eiJ3'></bdo><ul id='0eiJ3'></ul>
    1. <legend id='0eiJ3'><style id='0eiJ3'><dir id='0eiJ3'><q id='0eiJ3'></q></dir></style></legend>

      <small id='0eiJ3'></small><noframes id='0eiJ3'>

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

        Mysql - 从 unix 时间戳中选择年份

        时间:2023-10-26
        • <bdo id='CevFY'></bdo><ul id='CevFY'></ul>

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

            <tbody id='CevFY'></tbody>

                <tfoot id='CevFY'></tfoot>

                  <i id='CevFY'><tr id='CevFY'><dt id='CevFY'><q id='CevFY'><span id='CevFY'><b id='CevFY'><form id='CevFY'><ins id='CevFY'></ins><ul id='CevFY'></ul><sub id='CevFY'></sub></form><legend id='CevFY'></legend><bdo id='CevFY'><pre id='CevFY'><center id='CevFY'></center></pre></bdo></b><th id='CevFY'></th></span></q></dt></tr></i><div id='CevFY'><tfoot id='CevFY'></tfoot><dl id='CevFY'><fieldset id='CevFY'></fieldset></dl></div>
                1. <legend id='CevFY'><style id='CevFY'><dir id='CevFY'><q id='CevFY'></q></dir></style></legend>
                  本文介绍了Mysql - 从 unix 时间戳中选择年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用这个:

                  SELECT FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year FROM table_name WHERE year = 2009;
                  

                  但它给了我一个错误:

                  Unknown column 'year' in 'where clause'SELECT FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year FROM table_name WHERE year = 2009
                  

                  my_unix_timestamp_column"和table_name"都是正确的,我不知道为什么它给了我这个!!!

                  Both "my_unix_timestamp_column" and "table_name" are correct, i dont know why it gives me this!!!

                  我使用的是 PHP 5.3.0

                  I'm using PHP 5.3.0

                  推荐答案

                  我不太确定这是因为 YEAR 是 MySQL 中的保留字,还是因为它想让你做某事大致如下:

                  I'm not quite sure whether this is due to YEAR being a reserved word in MySQL or because it wants you to do something along the lines of:

                  SELECT
                    FROM_UNIXTIME(my_unix_timestamp_column, '%Y') AS year
                  FROM
                    table_name
                  WHERE
                    FROM_UNIXTIME(my_unix_timestamp_column, '%Y') = 2009;
                  

                  不记得上一期是否只与GROUPings 相关 :S

                  Can't remember whether the last issue is only relevant to GROUPings :S

                  这篇关于Mysql - 从 unix 时间戳中选择年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:mysql order by with union 似乎不起作用 下一篇:如何在同一个查询中添加两个选择命令的结果

                  相关文章

                    <bdo id='Aiu2o'></bdo><ul id='Aiu2o'></ul>

                  <tfoot id='Aiu2o'></tfoot>

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

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