I'm having trouble with a MySQL query. If the label is "5" then I only want records where there is more than 10 of them for the current day, but any number of rows for other labels. What is the best way to accomplish this in the query?
SELECT id,name,label,date
FROM items
GROUP BY DATE('date'), label
HAVING COUNT(id) > 10 IF label = 5