最简单的方式,在查询语句外再套一层,把查询结果当成一个表,再来分组。如:
select 别名1,sum(别名2) as 求和 from
(
select field1 as 别名1,a field2 as 别名2
from tablename
)as aa
group by 别名1
时间:2019-03-26 06:20:09
最简单的方式,在查询语句外再套一层,把查询结果当成一个表,再来分组。如:
select 别名1,sum(别名2) as 求和 from
(
select field1 as 别名1,a field2 as 别名2
from tablename
)as aa
group by 别名1