Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to get data between a last week in mysql

SELECT id FROM tbl
WHERE date >= curdate() - INTERVAL DAYOFWEEK(curdate())+6 DAY
AND date < curdate() - INTERVAL DAYOFWEEK(curdate())-1 DAY
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #data #week #mysql
ADD COMMENT
Topic
Name
1+1 =