how to change this dynamic rows to columns I have following columns (it is dynamic, more rows in table with same ID).Type can be duplicate.

+--------------+---------+------------
| ID           | TYPE    | VALUE     |
+--------------+---------+------------
|            1 | A     | one         |
|            1 | B     | gas         |
|            1 | C     | age         |
|            1 | D     | two         |
|            1 | E     | gas         |
|            1 | F     | age         |
|            2 | G     | env         |
|            2 | H     | mas         |
|            2 | I     | sat         |
+--------------+---------+-----------+


I am trying to get following output

ID | A  | B | C | D | E | F | G| H | I
1    one  gas age two gas age null null null
2    null null null null null env mas sat


How it is possible in Mysql
Following is the solution for static version:

SELECT id,
group_concat(DISTINCT IF(type='A',value,null)) 'A',
group_concat(DISTINCT IF(type='B',value,null)) 'B',
group_concat(DISTINCT IF(type='C',value,null)) 'C',
group_concat(DISTINCT IF(type='D',value,null)) 'D',
group_concat(DISTINCT IF(type='E',value,null)) 'E',
group_concat(DISTINCT IF(type='F',value,null)) 'F'
group_concat(DISTINCT IF(type='G',value,null)) 'G',
group_concat(DISTINCT IF(type='H',value,null)) 'H',
group_concat(DISTINCT IF(type='I',value,null)) 'I'
FROM test
GROUP BY id;


To implement dynamic version you must implement it via Stored Procedure or  from your programming language implementing solution based on your logic.