MySql count() to return 0 if no records found

前端 未结 6 1509
太阳男子
太阳男子 2020-12-17 20:10

I have a set of posts on monthly basis. Now i need an array which contains total records of posts posted in each month. I tried below MySql query, Its working fine, but I wa

6条回答
  •  旧时难觅i
    2020-12-17 20:56

    Did you try IFNULL() the right way? Maybe try IFNULL(Count(id), 0) in a SELECT clause with join.

提交回复
热议问题