I've got a table with people who've entered to win a truck.
tbl_contestants
Contestants can enter up to 100 times. I want to update the entry_type
on all records where the user has already entered 100 or more times.
I want to update all records where 100 or more records have email address of X. I need to determine X by getting a count of records with a repeating email address then save those records and update all of their entry_type
.
I'm using the email address as my selector since all entries have email addresses (required to enter).
Would I select a count somewhere in the query? This one has me baffled.
I've since updated the logic on the web form that limits any new entries to 100, I just need to deal with entries that occurred before we updated the logic.
Edit
I don't know the email addresses of all the entrants that have reached the 100 threshold. We're talking about a DB with 320K records. I need to figure out which email addresses occur over 100 times and then set entry_type to 100 on all of those records that met the 100 threshold.