I am having problems running a query in a table:
+-----+---------------------+-------+------+
| id | paid_date | amount| type |
+-----+---------------------+-------+------+
| 204 | 2010-10-22 05:12:54 | 1000 | 0 |
| 205 | 2010-10-22 05:13:12 | 1000 | 1 |
| 206 | 2010-10-21 05:13:44 | 1000 | 0 |
| 208 | 2010-10-22 05:57:33 | 1000 | 1 |
+-----+---------------------+-------+------+
The type column determines whether the money is coming in or not, so I would like to run a query that could give me this result.
+---------------------+-------+------+
| DATE(paid_date) | in | out |
+---------------------+-------+------+
| 2010-10-21 | 1000 | 0 |
| 2010-10-22 | 1000 | 2000 |
+---------------------+-------+------+
I do not know what I am doing wrong, I know that it is not so difficult, but it cannot happen :(
source
share