MySQL selecting yesterday's date

后端 未结 8 556
猫巷女王i
猫巷女王i 2020-12-02 10:08

How can I display and count the values whose dates are yesterday? I used time() to insert date in the database. Example:

URL: google.com youtube         


        
相关标签:
8条回答
  • 2020-12-02 11:04

    Query for the last weeks:

    SELECT *
    FROM dual
    WHERE search_date BETWEEN SUBDATE(CURDATE(), 7) AND CURDATE()
    
    0 讨论(0)
  • 2020-12-02 11:06
    SELECT SUBDATE(NOW(),1);
    

    where now() function returs current date and time of system in Timestamp...

    you can use:

    SELECT SUBDATE(CURDATE(),1)
    
    0 讨论(0)
提交回复
热议问题