select sum(column_name) from db_name where search_condition
Select name,sum(case when month=10 then money else 0 end) month10,
sum(case when month=11 then money else 0 end) month11
from t
group by name
order by name
欢迎分享,转载请注明来源:内存溢出
select sum(column_name) from db_name where search_condition
Select name,sum(case when month=10 then money else 0 end) month10,
sum(case when month=11 then money else 0 end) month11
from t
group by name
order by name
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)