I have a query that pulls meta data currently like:
SELECT order_id, meta_key, meta_valueFROM wp_woocommerce_order_items iINNER JOIN wp_woocommerce_order_itemmeta im ON i.order_item_id = im.order_item_idwhere 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 nathan@domain.com
2800 Name - 1 John Smith
2800 Email - 1 john@domain2.com
2800 Name - 2 Jane Doe
2800 Email - 2 jane@domain2.com
How can I modify so the output would be:
2668 Nathan Riley nathan@domain.com
2800 John Smith john@domain2.com
2800 Jane Doe jane@domain2.com
Thanks!
MySQL ServerSQL
Last Comment
Tomas Helgi Johannsson
8/22/2022 - Mon
David Favor
Use the SUBSTR() function, which can easily trim off some fixed number of leading characters.
https://www.w3resource.com