Problem :
We would like to get yesterday's date in MySQL database. So we need to execute query to solve this.
Solution :
Write bellow query to get yestarday date -
SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS yesterday_date;
Output :
Discussions :
To get yesterday day you need to substract one day from todays day. You need to use CURDATE() to get todays date. After then you need to substract one day from today using DATE_SUB() function. Here you need to substract one day as DATE_SUB(CURDATE(), INTERVAL 1 DAY).