I have the following three queries
SELECT COUNT(*) as cached_type_a, DATE(datetime) as datetime
FROM requests
WHERE cached = 'a'
GROUP BY DAY(datetime);
SELECT COUNT(*) as cached_type_b, DATE(datetime) as datetime
FROM requests
WHERE cached = 'b'
GROUP BY DAY(datetime);
SELECT COUNT(*) as cached_type_c, DATE(datetime) as datetime
FROM requests
WHERE cached = 'c'
GROUP BY DAY(datetime);
Is it possible to combine them into a single query with 4 columns
cached_type_a, cached_type_b, cached_type_c, datetime?
If you have only three possible values of
cache, you can use this,otherwise, if you have multiple number of cache, you can use
Prepared Statement