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.
我有一个看起来很像这样的数据库:
我想做一个 MySQL 查询,我计算每个id的票数,并从最高的开始排序。我希望输出如下:
是否可以在彼此之间不进行 3 个查询?
select name, sum(votes) as total_votes from mytable group by 1 order by 2 desc