Last active
January 2, 2016 12:09
-
-
Save remcotolsma/8301328 to your computer and use it in GitHub Desktop.
WP-Poll vote count distinct IP.
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 | |
vote.pollip_qid, | |
vote.pollip_aid, | |
answer.polla_answers, | |
COUNT( DISTINCT vote.pollip_ip ) | |
FROM | |
wp_pollsa AS answer | |
LEFT JOIN | |
wp_pollsip AS vote | |
ON answer.polla_aid = vote.pollip_aid | |
WHERE | |
vote.pollip_qid = 3 | |
GROUP BY | |
vote.pollip_aid | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment