Count all records from database where due date matches todays date

前端 未结 2 1269
自闭症患者
自闭症患者 2021-01-26 04:26

I need to count all records from database where due date matches today date. I found out that I should be able to do this using COUNT and CURDATE. But I am not able to get it ri

相关标签:
2条回答
  • 2021-01-26 04:58

    I tried my self and this is working :

    SELECT count(id) FROM `tasks ` WHERE due_date= CURRENT_DATE
    

    OR

    SELECT count(id) FROM `tasks ` WHERE due_date =  CURDATE()
    

    Read this it will clear you Concepts

    0 讨论(0)
  • 2021-01-26 05:03

    SELECT COUNT (id) FROM tasks WHERE due_date = CURDATE Just remove space between COUNT and (id) will work properly.

    0 讨论(0)
提交回复
热议问题