比如:
select sum(age) from user ORDER BY age desc limit 5;
我要查年龄前5的用户的年龄之和,但是这样查出来是所有用户的年龄之和
子查询
select sun(age)
from (select age from user ORDER BY age desc limit 5)
select sum(u.age)
from (select age from user ORDER BY age desc limit 5) as u