Created
June 21, 2016 02:18
-
-
Save rrrhys/f449cc34d2ed86f1732f8a283c404c79 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 pm_cust.meta_value as user_id, sum(pm_disc.meta_value) as disc_total | |
from wp_postmeta pm_cust | |
inner join wp_postmeta pm_disc | |
on pm_disc.post_id = pm_cust.post_id and pm_disc.meta_key = '_cart_discount' | |
where pm_cust.meta_key = '_customer_user' and pm_cust.meta_value = 8; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment