display month name instead of month number in mysql

后端 未结 1 1529
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 07:44

Write a query to display the name of the month and the number of events scheduled in each month in the year 2013, sorted by month. Give an alias to the month name as month_name

相关标签:
1条回答
  • 2021-01-29 08:43

    You should use MONTHNAME(date) - something like this:

    select MONTHNAME(date),COUNT(*) from event where year(date)=2013 group by MONTH(date)
    
    0 讨论(0)
提交回复
热议问题