Created
April 21, 2020 13:05
-
-
Save dokker/763ed1d36a78360a634017db9c6bda58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.ID, DATE_FORMAT(p.post_date, '%Y.%m.%d.'), pp.post_title AS 'coupon_title' | |
FROM `wp_posts` AS `p` | |
JOIN `wp_postmeta` AS `pm` ON pm.meta_value = p.ID | |
JOIN `wp_posts` AS `pp` ON pm.post_id = pp.ID | |
WHERE p.`post_type` LIKE 'shop_order' AND pm.meta_key LIKE '_used_by' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Non working query