I have a mysql function
SELECT * FROM `stats` WHERE BETWEEN '2011-01-03' AND '2011-01-01' AND `email`='sarah@sarah.com' AND `city`='New York' AND `location`='New York' AND `date` GROUP BY action
However I can't seem to get it working, it works if I take out the BETWEEN '2011-01-03' AND '2011-01-01' but not with it in, how can I make this function work?
解决方案WHERE BETWEEN '2011-01-03' AND '2011-01-01'
needs a column name to be compared. Is it the date column?
Then your query should look like this:
SELECT *
FROM `stats`
WHERE `date` BETWEEN '2011-01-01' AND '2011-01-03'
AND `email`='sarah@sarah.com'
AND `city`='New York'
AND `location`='New York'
GROUP BY action