MySQL query to view vertical data
- by wenkhairu
I have MySQL data that looks like this:
+----------------------------------------+
|Name | kode | jum |
+----------------------------------------+
| aman |kode1 | 2 |
| aman |kode2 | 1 |
| jhon |kode1 | 4 |
| amir |kode2 | 4 |
+--------------------+-----------+-------+
How can I make the table look like this one, using a MySQL query?
kode1 kode2 count
aman 2 1 3
jhon 0 4 4
amir 0 4 4