Jag skulle prova något i stil med:
SET @counter = 0;
SELECT (@counter:example@sqldat.com+1)%3 as rr, grp, name FROM table ORDER by rr, grp
Jag skulle prova något i stil med:
SET @counter = 0;
SELECT (@counter:example@sqldat.com+1)%3 as rr, grp, name FROM table ORDER by rr, grp