Mysql segregating data from one column to many based on another column
<p>How to populate selective values from one column to another column based on condition on second column? I have data in the following format </p>

<pre><code>**name         role_id** 
-------------------------
jack           6 
jill           8  
humpty         9 
dumpty         9  
</code></pre>

<p>Looking for Output </p>

<pre><code>**'6'          '8'       '9'** 
-------------------------------
jack        jill      humpty
NULL        NULL      dumpty 
</code></pre>

<p>so how can I segregate data based on role_id?</p>