Count all records from database where due date matches todays date

前端 未结 2 1268
自闭症患者
自闭症患者 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

提交回复
热议问题