Mysql query list results matching each date
Not sure how this would work. I have a between query, but how would I run a query to list results that match each and every day. Example, enterys that exists on 2011-06-17, 开发者_开发技巧2011-06-18, 2011-06-19 and 2011-06-20
SELECT lookup, `loc`, `octect1` ,`octect2` ,`octect3` ,`octect4`, date, time, count(`lookup`) as count FROM index
WHERE date between '2011-06-17' AND '2011-06-20'
GROUP BY lookup
ORDER BY count DESC
Thanks
Instead of BETWEEN
, use comparison operators:
SELECT lookup, `loc`, `octect1` ,`octect2` ,`octect3` ,`octect4`,
date, time, count(`lookup`) as count
FROM index
WHERE date > '2011-06-17' AND date < '2011-06-20'
GROUP BY lookup
ORDER BY count DESC
精彩评论