对于我遇到的问题,我已经解决了以下问题:
SELECT Event_id, SUM(Money) AS 'Total Money'
FROM prize
GROUP BY Event_id
ORDER BY 'Total Money' DESC;
但是,它不按总金额排序。如果我省略“”标记并调用 Total_Money 列,它可以正常工作:
SELECT Event_id, SUM(Money) AS Total_Money
FROM prize
GROUP BY Event_id
ORDER BY Total_Money DESC
为什么是这样?有没有办法调用 Total Money 列并按我想要的方式排序?