mysql order by 子查詢 後面的結果 如何 也顯示在結果集裡
我的 mysql語句:
SELECT * FROM wht_user AS t1 WHERE pid =79 ORDER BY (
SELECT sum( `distribution_money` ) AS
AGGREGATE FROM wht_distribution_detail AS t2
WHERE t1.id = t2.uid
AND `puid` =79
AND `status` =4
GROUP BY `uid`
ORDER BY `updatetime` DESC
) DESC
如何 將 AGGREGATE 也顯示在結果集裡 或有什麼 更好的辦法?
求人不如求己 已解決: