title: MySQL: Convert column into rows
body: <p>I have a zillion of colums that I need to convert into rows.</p>
  
  <p>I have 3 main categories (CAT, ODB &amp; GPA)
  Each category has a month (From Jan, to Dec) and each category has a year)
  Here is a sample of the structure:</p>
  
  <blockquote>
    <p>CATJAN2002 | CATFEB2002...| CATDEC2002...| ODBJAN2003...| GPAMAR2013</p>
  </blockquote>
  
  <p>In vba I can create a simple loop, to export this data into another table:</p>
  
  <p><code>New_Table</code> fields:
  <code>ID, TYPE, YEAR, MONTH, VALUE</code>
  . Can YOU PLEASE help me find a way to automatically go thought the table's columns and start inputing the data into the new table? Can this be done in MySQL alone?</p>
  
  <p>I forgot to menton that the combination of the first columns (STORE, ITEM  &amp; CUSTOMER ) is the ID (Or primary key) [<code>SELECT CONCAT(STORE, ITEM, CUSTOMER) AS ID</code></p>