Created
March 14, 2023 23:44
-
-
Save digisavvy/6315f4e9e0464f089e8b384e51171821 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 la.license_id, COUNT(*) as num_activations, c.id as customer_id, c.email, la.site_name | |
FROM wp_edd_license_activations la | |
INNER JOIN wp_edd_licenses l ON la.license_id = l.id | |
INNER JOIN wp_edd_orders o ON l.payment_id = o.id | |
INNER JOIN wp_edd_customers c ON o.customer_id = c.id | |
WHERE la.activated = 1 | |
GROUP BY la.license_id, la.site_name, c.id, c.email | |
ORDER BY num_activations DESC | |
LIMIT 10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment