MySQL Query GROUP BY day / month / year

前端 未结 14 2523
野趣味
野趣味 2020-11-22 06:37

Is it possible to make a simple query to count how many records I have in a determined period of time like a year, month, or day, having a TIMESTAMP field, like

14条回答
  •  一整个雨季
    2020-11-22 06:55

    .... group by to_char(date, 'YYYY') --> 1989

    .... group by to_char(date,'MM') -->05

    .... group by to_char(date,'DD') --->23

    .... group by to_char(date,'MON') --->MAY

    .... group by to_char(date,'YY') --->89

提交回复
热议问题