0
我有這個表:Mysql的印刷前n行的結果
Orders(Orderid,CustomerID,Amount)
我問前10客戶的ID(訂單總金額)
我寫的查詢將作爲打印所有客戶(最高金額到最低金額)
select CustomerID, sum(Amount) as Total from orders group by CustomerID order by Total desc;
我怎樣才能得到這個結果的前10行?或者是我獲得前10名錯誤的方法?
謝謝您的回答它的工作原理。我甚至不知道在mysql中有一個限制參數:/ –