I have the following SQL which works great at this stage:
INSERT INTO recEntrantStatus (entrantId, roundId, judgeId, notified, voted, enterNextRound)
SELECT entrantId, (@round + 1), judgeId, 0, 0, 0
FROM recEntrantStatus
WHERE roundId = @round
AND voted = 1
AND enterNextround = 1
This code checks for all rows where enterNextRound is true, and then creates a new row for each of them.
However, I now need to expand this so that:
-
Check a second table (
tblJudges) for all judges and get an array of all the judges Id’s (Id) -
Do the same as in the above example except now creating each of the above rows for each of the judges / judges Id’s obtained from step 1.
Any help / suggestions would as always be greatly appreciated.
Thanks!
If I’m understanding you correctly, this may be helpful:
We’re getting the same thing as before, only multiplied by the amount of judges, if you will (and using individual judge IDs).