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.
我有一张桌子:
uid_from uid_to count x1 x2 3 x3 x2 5 x8 x1 99 x9 x1 1
并想生成一个像这样的求和表:
uid_to sum x1 100 x2 8
我可以在 PHP 中完成,但宁愿直接在 MySQL 查询中完成。我应该注意到该表有 7 亿行。
select uid_to, sum(count) as sum from your_table group by uid_to