0
我有以下MySQL表:Mysql的行列
+----+-----+-----+--------+
| id | sid | tid | val |
+----+-----+-----+--------+
| 1 | 1 | 1 | square |
| 2 | 1 | 2 | big |
| 3 | 1 | 3 | red |
| 4 | 2 | 1 | circle |
| 5 | 2 | 2 | small |
| 6 | 2 | 3 | yellow |
+----+-----+-----+--------+
而且我需要一個查詢,以得到如下結果:
+-----+--------+-------+--------+
| sid | figure | size | colour |
+-----+--------+-------+--------+
| 1 | square | big | red |
| 2 | circle | small | yellow |
+-----+--------+-------+--------+
任何想法?
謝謝。
你怎麼知道標題應該是'figure','size'和'colour'列?這是存儲_somewhere_或者你只是猜測? – Taryn
列標題並不重要。謝謝。 – cornell