I have the following table
+----------+----------+
| data | valor |
+----------+----------+
| 16/05/15 | 1 |
| 16/05/15 | 0 |
| 16/05/15 | 1 |
| 16/05/15 | 0 |
| 17/05/15 | 2 |
| 17/05/15 | 1 |
| 17/05/15 | 1 |
| 17/05/15 | 0 |
| 18/05/15 | 2 |
| 18/05/15 | 2 |
| 18/05/15 | 1 |
| 18/05/15 | 0 |
| 19/05/15 | 2 |
| 19/05/15 | 2 |
| 19/05/15 | 2 |
| 19/05/15 | 2 |
+----------+----------+
I need to make a sql that counts the amount of 0, 1 and 2, however I'm only able to do with sql, how can I make a single select?
SELECT data, COUNT(valor)
FROM treatment_output
WHERE valor = 0
GROUP BY data ORDER BY data