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

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

        <legend id='SvFNn'><style id='SvFNn'><dir id='SvFNn'><q id='SvFNn'></q></dir></style></legend>
      1. MySQL 按日期分组并从 unix 时间戳转换

        MySQL group by date and convert from unix timestamp(MySQL 按日期分组并从 unix 时间戳转换)
            <bdo id='RmoMC'></bdo><ul id='RmoMC'></ul>

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

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

                  <tbody id='RmoMC'></tbody>

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

                  <tfoot id='RmoMC'></tfoot>

                • 本文介绍了MySQL 按日期分组并从 unix 时间戳转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有如下sql表(简体)

                  I have the following sql table (simplified)

                  ID (int)  title (text)            date (int)
                  --------------------------------------------
                  1         Hello World             1378148920
                  2         Hello World2            1378182183
                  3         Hello World3            1378129838
                  4         Hello World4            1378146160
                  5         Hello World5            1378138038
                  ....
                  

                  该表有数千个条目.

                  我不想问你是否可以构建一个 SQL 查询,将所有帖子按日期分组,但仅按天分组.

                  I wan't to ask you if it is possible to build a SQL query that groups all the posts by date but only as day.

                  所以最后我不想构建这样的图表(过去 5 天):

                  So at the end I wan't to build a graph like this (for the last 5 days):

                  02.09.2013: 13 posts
                  01.09.2013: 14 posts
                  

                  注意:时间戳不是真实的(它们都是从今天开始的)

                  NOTE: the timestamp aren't real (they are all from today)

                  推荐答案

                  你可以使用from-unixtime()

                  select FROM_UNIXTIME(`date`, '%d.%m.%Y') as ndate,
                         count(id) as post_count
                  from your_table
                  group by ndate
                  

                  这篇关于MySQL 按日期分组并从 unix 时间戳转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

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

                        • <small id='IG1eB'></small><noframes id='IG1eB'>