Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 'stats' 表和 'id'、'playername'、'point'、'asist' 列。我想制作像这张图片的表。
例子:
我怎么能只用 1 个查询来做到这一点?
您可以为此使用UNION ALL运算符
UNION ALL
SELECT 'Points','Leaders' UNION ALL SELECT Playername,point order by point desc UNION ALL SELECT 'AsIst','Leaders' UNION ALL SELECT Playername,asist order by asist desc
希望这可以帮助。