title: Create new table with data from Wordpress wp_postmeta table
body: <p>The goal is to migrate the data related to a product definition stored in a Wordpress table (in this case, credit cards).</p>
  
  <p>Here is an example of the data I want to migrate:</p>
  
  <pre><code>SELECT meta_key, meta_value FROM wp_postmeta WHERE post_id = 366;
  
  +-----------------+------------------------------------+
  | meta_key        | meta_value                         |
  +-----------------+------------------------------------+
  | Name            | Santos Futebol Clube International |
  | Issuer          | Bradesco Banco                     |
  | Issuer_Subtype  | Bradesco                           |
  +-----------------+------------------------------------+
  </code></pre>
  
  <p>There are many more fields, but I show three of them just as an example.
  There is also many product items (each post represents an item).</p>
  
  <p>I want to migrate these data into a table with the following structure:</p>
  
  <pre><code>DESCRIBE card;
  
  +-----------------------+--------------+------+-----+---------+----------------+
  | Field                 | Type         | Null | Key | Default | Extra          |
  +-----------------------+--------------+------+-----+---------+----------------+
  | id                    | int(11)      | NO   | PRI | NULL    | auto_increment |
  | name                  | varchar(255) | YES  |     | NULL    |                | 
  | issuer                | varchar(255) | YES  |     | NULL    |                |
  | issuer_subtype        | varchar(255) | YES  |     | NULL    |                |
  +-----------------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>Since the data in the Wordpress table representing each item is located in different rows, I'm having problems trying to grasp my head around how to make a query that can achive this.</p>
  
  <p>Any suggestions?</p>