Given the table of votes (users vote for the choice and must specify an email address):
votes
--
id: int
choice: int
timestamp: timestamp
ip: varchar
email: varchar
What is the best way to count the “unique” votes (a user who is a unique combination of email + ip), given the restriction they can only vote on twice an hour?
You can count the number of hours between the first and last vote and determine the maximum number of votes allowed for this timeframe, but this allows users to compress all their votes, say a one-hour window and still have them counted.
I understand that anonymous voting on the network is inherently wrong, but I'm not sure how to do this with SQL. Should I use an external script or something else? (For each choice, for each pair of email + ip, get a vote, calculate the next + 1st time stamp, count / cancel / count votes, go to the next hour, etc.)
Karen t
source
share