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.
The problem is that each data field for the user is contained in separate rows (this is how Wordpress sets up the data structure).
For example, wp_usermeta has multiple rows of data for each user like this:
user_id meta_key meta_data
2 first_name Jane
2 last_name Austin
2 email [email protected]
3 first_name Jack
3 last_name Palmer
3 email [email protected]
I need the data to be combined into one row, separate fields, like this:
user_id first_name last_name email
2 Jane Austin [email protected]
3 Paul Parker [email protected]
I have searched around and cannot find this exact problem anywhere (I found a lot of concatenation, but that is not what I need).