First, I already read all post with same title post. But no solution solve my problem.
I want my query result's like this
kategori | hitung
Good | 2
Nice | 0
great | 1
with this query:
SELECT kategori, COALESCE(COUNT(kategori), 0) AS hitung FROM tb_cust WHERE id_sales=9 GROUP BY kategori DESC
But the result only return 2 data:
kategori | hitung
Good | 2
great | 1
Did my query is wrong?
Edit:
this is my table and the data inside of it
table name: tb_cust
id_cust | name_cust | kategori | id_sales
1 | Name 1 | Good | 9
2 | Name 2 | Good | 9
3 | Name 3 | Great | 9