引用:SQL code??12345select 表1.name,sum(case when 表2.fnum = 1 then 表2.feiyong else 0 end) as '短信费' , sum(case when 表2.fnum = 2 then 表2.feiyong else 0 end) as '月租费'from 表1,表2……