ORCLE中SQL语句这句是什么意思呀!
SELECT '合计' areaname,SUM(c1) c1,SUM(c2) c2,SUM(c3) c3,SUM(c4) c4,SUM(c5) c5,SUM(c6) c6,SUM(c7) c7,SUM(c8) c8,SUM(c9) c9,SUM(c10) c10,SUM(c11) c11,SUM(c12) c12,SUM(c13) c13,SUM(c14) c14,SUM(c15) c15,SUM(c16) c16,SUM(c17) c17,SUM(c18) c18,SUM(c19) c19,SUM(c20) c20,SUM(c21) c21,'910' oldareaidFROM(
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
)
)
ORDER BY oldareaid
语句中DECODE以及后面参数是干什么的呀?我只知道SUM是统计的