I have a database in which i need to convert the columns as rows.
+--------+------+-----+-----+
| ID | Name | A | B |
+--------+------+-----+-----+
| 1 | xyz | 3 | 1 |
| 2 | abc | 4 | 6 |
+--------+------+-----+-----+
and i need to display like this if incase is it possible to reduce redandancy and make another table to pass the id for that?
+--------+----------+-----------+---------+
| ID | Name | Type | Cost |
+--------+----------+-----------+---------+
| 1 | xyz | A | 3 |
| 1 | xyz | B | 1 |
| 2 | abc | A | 4 |
| 2 | abc | B | 6 |
+--------+----------+-----------+---------+
please, give me any solutions for this query....
Thanks in Advance