troubleshooting Question

MySQL Query Syntax

Avatar of Nathan Riley
Nathan RileyFlag for United States of America asked on
6 Comments4 Solutions158 ViewsLast Modified:
I have a query that pulls meta data currently like:

SELECT order_id, meta_key, meta_value
FROM wp_woocommerce_order_items i
INNER JOIN wp_woocommerce_order_itemmeta im ON i.order_item_id = im.order_item_id
where meta_key like '%Name - %'
or meta_key like '%Job Title - %'
or meta_key like '%Company - %'
or meta_key like '%Email - %'

The output is:
2668 Name - 1 Nathan Riley
2668 Email - 1
2800 Name - 1 John Smith
2800 Email - 1
2800 Name - 2 Jane Doe
2800 Email - 2

How can I modify so the output would be:
2668 Nathan Riley
2800 John Smith
2800 Jane Doe

hemant saini

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros