我正在執行一個查詢,我在其中使用連接。在這我已經使用了一個將總量的子查詢。我想按照下面的子查詢的結果進行排序。mysql排序和使用子查詢之間
"select users.*, (select sum(amount) as camount from donation where donation.uid=users.id) as camount from users where users.confirmed=1 and camount between 3 and 5 order by camount";
我得到一個錯誤:1064
如何使用子查詢的結果sotring查詢?
不完全是什麼OP希望。查詢獲得*每個*記錄的* all *用戶總數。 – 2011-01-10 14:33:00