title: Merging multiple rows into one row and multiple columns on mysql
body: <p>I am working in MYSQL and need to extract user data to be pulled into a view. I will be using the data in an email client, so I cannot do this in the app layer. </p>
  
  <p>The problem is that each data field for the user is contained in separate rows (this is how Wordpress sets up the data structure). </p>
  
  <p>For example, wp_usermeta has multiple rows of data for each user like this:</p>
  
  <pre><code>user_id   meta_key       meta_data
     2      first_name     Jane
     2      last_name      Austin
     2      email          jane@me.com
     3      first_name     Jack
     3      last_name      Palmer
     3      email          jack@me.com
  </code></pre>
  
  <p>I need the data to be combined into one row, separate fields, like this:</p>
  
  <pre><code>user_id  first_name  last_name  email
  2        Jane        Austin     jane@email.com
  3        Paul        Parker     jack@email.com
  </code></pre>
  
  <p>I have searched around and cannot find this exact problem anywhere (I found a lot of concatenation, but that is not what I need).</p>