How to select all distinct values except one in MySQL?
<p>I have a MySQL query in PHP where I am getting all distinct values and then getting the sums of associated columns of these distinct values  like this:</p>

<pre><code>SELECT t.`fruits`,sum(coalesce(s.amount,0)),sum(coalesce(s.price,0))
FROM(SELECT DISTINCT `fruits` FROM `accouts`) t
LEFT OUTER JOIN `accounts` s
 ON(t.`fruits` = s.`fruits` AND s.`userid` = 1
AND s.`date` BETWEEN "2010-11-01" AND "2015-12-22")
GROUP BY t.`fruits`
</code></pre>

<p>How can I exclude a certain distinct value from this query? Specifically if the "fruits" column is empty? Because this returns data like this:</p>

<pre><code>Oranges - 23 - 43
Pears   - 33 - 55
        - 12 - 13
Grapes  - 54 - 76
</code></pre>

<p>I want to exclude the distinct row where "fruits" is empty. How can I go about doing this?</p>