For example, I have those data:
username,credits
user1,20
user2,30
user3,20
user4,20
user5,10
user6,30
...
they may have many many rows.(let's say 1000 )
but the credits group is limit.( let's say no more than 10)
How to make a group by query and pick up few data from each group? eg: 3 for each credit, the result is expected as bellow:
user5,10
userX,10
userY,10
user1,20
user3,20
user4,20
user2,30
user6,30
userZ,30
...
How to do that?