|
楼主 |
发表于 2011-2-18 09:39:10
|
显示全部楼层
找到办法了,再嵌套一层,就可以实现排序,不知道有没有更好的办法?
我用的这个:
SELECT * FROM
(select (select sum(income.money) from income where ct_id=c.client_id) as sum_money,(参考第一个) as sum_i_money,(参考第一个) as sum_r_money from clients c)
AS a
ORDER BY sum_money DESC; |
|