ORCLE中SQL语句这句是什么意思呀!
select areaname 分公司,c1 SDH,c2 出租网元,c3 小计1,c4 ATM,c5 FR,c6 MPLSVPN,c7 DDN,c8 设备出租,c9 设备代维,c10 小计2,c11 普通,c12 汇聚,c13 小计3,c14 XDSL,c15 LAN,c16 其他,c17 小计4,c18 服务器托管,c19 机架租赁,c20 小计5,c21 合计FROM(
SELECT MAX(areaname) areaname,
SUM(DECODE(classname,'SDH',fee,0)) c1,
SUM(DECODE(classname,'出租网元',fee,0)) c2,
SUM(DECODE(classname,'SDH',fee,0)+DECODE(classname,'出租网元',fee,0)) c3,
SUM(DECODE(classname,'ATM',fee,0)) c4,
SUM(DECODE(classname,'FR',fee,0)) c5,
SUM(DECODE(classname,'MPLSVPN',fee,0)) c6,
SUM(DECODE(classname,'DDN',fee,0)) c7,
SUM(DECODE(classname,'设备出租',fee,0)) c8,
SUM(DECODE(classname,'设备代维',fee,0)) c9,
SUM(DECODE(classname,'ATM',fee,0)+DECODE(classname,'FR',fee,0)+DECODE(classname,'MPLSVPN',fee,0)+DECODE(classname,'DDN',fee,0)+DECODE(classname,'设备出租',fee,0)+DECODE(classname,'设备代维',fee,0)) c10,
SUM(DECODE(classname,'互联网专线普通',fee,0)) c11,
SUM(DECODE(classname,'互联网专线汇聚',fee,0)) c12,
SUM(DECODE(classname,'互联网专线普通',fee,0)+DECODE(classname,'互联网专线汇聚',fee,0)) c13,
SUM(DECODE(classname,'XDSL',fee,0)) c14,
SUM(DECODE(classname,'LAN',fee,0)) c15,
SUM(DECODE(classname,'其他',fee,0)) c16,
SUM(DECODE(classname,'XDSL',fee,0)+DECODE(classname,'LAN',fee,0)+DECODE(classname,'其他',fee,0)) c17,
SUM(DECODE(classname,'服务器托管',fee,0)) c18,
SUM(DECODE(classname,'机架租赁',fee,0)) c19,
SUM(DECODE(classname,'服务器托管',fee,0)+DECODE(classname,'机架租赁',fee,0)) c20,
SUM(DECODE(classname,'合计',fee,0)) c21,
oldareaid
FROM(
SELECT MAX(areaname) areaname,SUM(fee) fee,oldareaid,classname
FROM REPORT_INCOME
WHERE billingcycleid='200702'
GROUP BY oldareaid,classname
)
GROUP BY oldareaid
DECODE(classname,'服务器托管',fee,0)) 这句谁能解释下?里面的FEE参数是什么意思?