我有一个mysql表:
Game | Type
-------|----------
Game1 | Action
Game2 | Roleplay
Game3 | Action
Game4 | Sandbox
Game5 | Sandbox
Game6 | Roleplay
Game7 | Fighting
Game8 | Fighting
Game9 | Adventure
Game10 | Adventure
Game11 | Action
Game12 | Roleplay
Game13 | Action
Game14 | Sandbox
Game15 | Sandbox
Game16 | Roleplay
Game17 | Fighting
Game18 | Fighting
Game19 | Adventure
Game20 | Adventure
Game21 | Roleplay
Game23 | Action
Game24 | Sandbox
Game25 | Sandbox
我如何将它们分成5组,每组5个,如下所示:
Game1 | Action
-------|----------
Game3 | Action
Game7 | Action
Game11 | Action
Game13 | Action
Game2 | Roleplay
Game6 | Roleplay
Game9 | Roleplay
Game12 | Roleplay
Game19 | Roleplay
Game7 | Fighting
Game8 | Fighting
Game17 | Fighting
Game18 | Fighting
Game18 | Fighting
Game9 | Adventure
Game10 | Adventure
Game19 | Adventure
Game20 | Adventure
Game20 | Adventure
Game4 | Sandbox
Game5 | Sandbox
Game14 | Sandbox
Game15 | Sandbox
Game15 | Sandbox
最好使用1个sql和 mysqli_query
.
1条答案
按热度按时间e0uiprwp1#
两个问题。