select com,time,
sum(case when type='1#' then quote else 0 end) as 1#,
sum(case when type='2#' then quote else 0 end) as 2#,
sum(case when type='3#' then quote else 0 end) as 3#
from (select ... from 查找后生成的表)
group by com,time
sum(case when type='1#' then quote else 0 end) as 1#,
sum(case when type='2#' then quote else 0 end) as 2#,
sum(case when type='3#' then quote else 0 end) as 3#
from (select ... from 查找后生成的表)
group by com,time
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货