my table name is 'complain'
+---------------+-------------------+
| date_complain | kategory_complain |
+---------------+-------------------+
| 2019-01-01 | green |
| 2019-01-01 | green |
| 2019-01-01 | yellow |
| 2019-01-02 | yellow |
| 2019-01-02 | red |
+---------------+-------------------+
i want count each green, yellow and red then order by date_complain asc
+---------------+-------+--------+-----+
| date_complain | green | yellow | red |
+-------------- +-------+--------+-----+
| 2019-01-01 | 2 | 1 | 0 |
| 2019-01-02 | 0 | 1 | 1 |
+---------------+-------+--------+-----+
i try if count, union and its not work.