GROUP BY month on DATETIME field

后端 未结 5 1274
我寻月下人不归
我寻月下人不归 2021-01-02 08:49

I have the following query in mysql:

SELECT title, 
       added_on 
FROM   title 

The results looks like this:

Somos Tão J         


        
5条回答
  •  轮回少年
    2021-01-02 09:32

    select 
           count(*) as Count,
           MONTH(timestamp)+"-"+YEAR(timestamp) as Month 
    from 
           title 
    GROUP BY 
            MONTH(tumestamp);
    

提交回复
热议问题