Hasil pesanan mysql mengikut subquery juga dipaparkan dalam set hasil
Pernyataan mysql saya:
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
Bagaimana untuk memaparkan AGREGATE dalam set keputusan?
Lebih baik meminta orang lain daripada meminta diri sendiri