What's wrong with this query?
Just a simple error I hope [img]images/smilies/smile.gif[/img]
What's wrong with this?
SELECT * FROM blog GROUP BY date WHERE date LIKE '200305%' LIMIT 0 , 30
This is the error I'm getting:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE date LIKE '200305%' LIMIT 0, 30' at line 1
Isn't date a reserved keyword? Try
SELECT * FROM blog GROUP BY `date` WHERE `date` LIKE '200305%' LIMIT 0 , 30
I've tried what you suggested - but no joy. The error is still there.
Ahhhh, just realised another of those silly mistakes
You can't use WHERE with GROUP BY, you have to use HAVING instead