day of week mysql code example
Example 1: sql select data from last week
select id from tbname
where date between date_sub(now(),INTERVAL 1 WEEK) and now();
Example 2: this week mysql
SELECT *
FROM your_table
WHERE YEARWEEK(`date`, 1) = YEARWEEK(CURDATE(), 1)
Example 3: mysql get day of week
DAYOFWEEK();//(1 for Sunday,2 for Monday …… 7 for Saturday )
Example 4: mysql date of the week
DAYOFWEEK(date)