每个月的第31天要低于下个月。例如,5月31日将在6月以下

时间:2018-08-27 08:45:52

标签: mysql date calendar

select  jiraissue.issuetype, component.cname, issuetype.pname,
        jiraissue.issuestatus,issuestatus.pname, jiraissue.created,
        CONCAT(monthname(jiraissue.created)," ",
                    year(jiraissue.created)) as monthyear,
        jiraissue.RESOLUTIONDATE,
        count(jiraissue.id), avg(DateDIFF(jiraissue.RESOLUTIONDATE,
        jiraissue.created)) as days_to_close,
        month(jiraissue.Created) as month
    from  project
    join  jiraissue  ON project.id=jiraissue.project
    join  issuetype  ON jiraissue.issuetype = issuetype.id
    JOIN  issuestatus  ON jiraissue.issuestatus = issuestatus.id
    left JOIN  nodeassociation  ON jiraissue.id = nodeassociation.source_node_id
    left JOIN  component  ON nodeassociation.sink_node_id = component.id
    where  project.pkey='EWSMSP'
      and  jiraissue.RESOLUTIONDATE is not null
      and  jiraissue.created > {{since}}
      and  issuetype.pname in('Incident')
    group by  month
    order by  month

Table

您可以看到第一个创建于3月31日,但在“月份”列中显示了4月。第三条记录也一样。

0 个答案:

没有答案