This is the table:
name | id |
--------------------
jim | 267
jill | 267
larry| 268
tim | 269
riley| 267
joe | 301
pete | 301
gil | 110
shay : 701
bill | 301
The desired result is separate into 5 categories, different numbers should be scattered across the categories while keeping same numbers together:
cat 1 | cat 2 | cat 3 | cat 4 | cat 5
------------------------------------------------
jim 267 |Larry 268 |joe 301 |gil 110 |shay 701
jill 267 |tim 269 |pete 301| |
riley 267| |bill 301| |
So essentially I want to grouping like while separating different id's as much as possible.