My question is:
I have a table containing 25 records of people names. But I need to randomly divide it into 5 groups of 5 people.
Being a 'Group A' table with 5 people, another table 'Group B' with 5 people and so on.
You need to be in SQL Server because the mass of data is much larger than this. Does anyone know how to use the rand()
function?
I put it like this:
select * from pessoas order by RAND()
But how do I put, for example, to separate into groups of 5?