Created
November 5, 2020 17:20
-
-
Save devinsays/aa1fdcc2c018fed982702ce9d4d716fe to your computer and use it in GitHub Desktop.
active-subscriber-ids.sql
This file contains hidden or 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
/* | |
* MySQL query to run site running WooCommerce Subscriptions. | |
* Selects all user ids for customers with an active subscriptions. | |
*/ | |
select | |
meta.meta_value as user_id | |
from | |
wp_qftw_posts posts | |
left join wp_qftw_postmeta meta ON meta.post_ID = posts.ID | |
where | |
posts.post_type = 'shop_subscription' | |
and posts.post_status = 'wc-active' | |
and meta.meta_key = '_customer_user'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment