Hello All:
I've collected a number of entries in a table for a sweepstakes. I've been asked by the client to provide:
- The number of unique entries
- The number of entries that occur twice.
- The number of entries that occur three times.
I'm able to determine the number of unique entries, but not sure how to pull out the number of entries that occur a specific number of times. I tried something like this:
SELECT email, count(email) AS NumberOfEntries
FROM entries
GROUP BY NumberOfEntries
That gives the error: Can't group on 'NumberOfEntries'
I'm hoping to see something like this:
NumberOfEntries / Total
1 / 1,000 (Meaning 1,000 people entered once and only once)
2 / 1,300 (Meaning 1,300 people entered exactly twice)
Thanks for any help!