+--------+----------+-----------+---------+
| hostid | itemname | itemvalue | quantity|
+--------+----------+-----------+---------+
| 1 | A | 10 | 1 |
| 1 | B | 3 | 2 |
| 2 | A | 9 | 3 |
| 2 | c | 40 | 4 |
+--------+----------+-----------+---------+
如何查询数据库以返回如下内容:
+--------+-----------------+-----------------+-------------------+
| hostid | A | B | C |
| |-------+---------+-------+---------+--------+----------+
| |itemval| quantity|itemval| quantity| itemval| quantity |
+--------+-------+---------+-------+---------+--------+----------+
| 1 | 10 | 1 | 3 | 2 | nuLL | NULL |
| 2 | 9 | 3 | NULL| nULL | 40 | 4 |
+--------+-------+---------+-------+---------+--------+----------+
任何人都可以帮我吗?