When I use this query, it assigns every row to the same value. Is there anyway to make this not happen?
UPDATE Team
SET GroupID = CAST(RAND() * 4 AS INT)
TO CLARIFY: This is to be used with Netbeans to assign group numbers to teams.
+----+----------+-------------+------------------+---------+
| ID | School | TeamCaptain | Email | GroupID |
+----+----------+-------------+------------------+---------+
| 1 | School 1 | John | email@email.com | NULL |
| 2 | School 2 | James | email2@email.com | NULL |
+----+----------+-------------+------------------+---------+
SandySands method works. However, is there any way to make it so that the same number can't appear more than 4 times?