Q:

MySql Sub Select

I need to query a table and gather counts with and without a column value. 
What is the count of records that contain column value on 'src' and the count without. 
Problem
Results contain one day only instead of every day on each row.  Each row has same values. 
Results Expected
DAY, CONTAINS VALUE, DOESN'T CONTAIN VALUE
Query
SELECT 
    DATE_FORMAT(edate,'%Y-%m-%d') as day,

(SELECT 
COUNT(id) FROM  entries WHERE src='a string' and color = 'red') with_value,

(SELECT 
COUNT(id) FROM  entries WHERE src='' and color = 'red') without_value

FROM entries 

GROUP BY day
ORDER BY day DESC

A:

You can do it without subqueryes using this technique:
SELECT 
    DATE_FORMAT(edate,'%Y-%m-%d') as day,
    SUM(src = 'a string') as with_value,
    SUM(src = '') as without_value

FROM entries 

GROUP BY day
ORDER BY day DESC

What I did there was take advantage of the fact that MySQL does not have a Boolean data type, but rather TRUE is identical to 1, and FALSE to 0, in effect having the SUM act as a COUNT of rows that satisfy the condition.