title: How to convert a row value to column header in mysql for Wordpress database
body: <p>Using the following query I have fetched results from wp_posts and wp_postmeta table.</p>
  <blockquote>
  <p><strong>SELECT a.<em>, b.</em> FROM wp_posts a, wp_postmeta b WHERE a.ID = b.post_id
  AND a.post_status = 'publish' AND a.post_type='wpsc-product'</strong></p>
  </blockquote>
  <p>From the above result, I want to filter the results to one more stage</p>
  <p>As you know wp_postmeta structure is like</p>
  <blockquote>
  <p><strong>meta_id  |  post_id |  meta_key | meta_value</strong></p>
  </blockquote>
  <p>I want to make all the meta_key values of the result to column names and its corresponding value as its value.</p>
  <p>For eg if the table is like:</p>
  <p>Meta_id-----------post_id-----------meta_key-----------meta_value</p>
  <blockquote>
  <p>1-----------------31--------------mk1----------------mv1</p>
  <p>2-----------------31--------------mk2----------------mv2</p>
  <p>3-----------------31--------------mk3----------------mv3</p>
  </blockquote>
  <p><strong>The expected result is:</strong></p>
  <p>Meta_id-----------post_id-----------mk1--------mk2---------mk3</p>
  <blockquote>
  <p>1-----------------31-----------------mv1---------mv2---------mv3</p>
  </blockquote>
  <p>Is this possible??? I want this along with my join query.</p>
  <p>The formatting of question is not correct. Please forgive for that.</p>