how to change this dynamic rows to columns
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.