I have a query of this form:
SELECT e.date, SUM(e.size) as bytes
FROM entries AS e
GROUP BY e.date
ORDER BY bytes DESC
and I have a column named client, which is composed of static values (0,1,2,3), so I want to get this:
SELECT e.date, SUM(e.size) as bytes
FROM entries AS e
WHERE e.client = 0
GROUP BY e.date
ORDER BY bytes DESC
repeated for every client type but in a single query to get a result of a summarized size for every client type:
DATE | CLI0-SIZE | CLI1-SIZE | CLI2-SIZE | CLI3-SIZE
2010-11-11 113 344 435 155
You can try this