2 qq 25237881 qq_25237881 于 2016.03.09 15:09 提问

求问:这个sql语句有什么错误,放在Oracle Sql Developer上运行错误,求解

" select t3.dw,nvl(t4.adhf,0),nvl(t4.ayhf,0),nvl(t4.azl,0),nvl(t4.cdhf,0),nvl(t4.cyhf,0),nvl(t4.czl,0)"+
" from "+
" (select '便民中心' as dw from dual union select '纪委' as dw from dual union select '督查支队' as dw from dual"+
" union select '国保支队' as dw from dual union select '经侦支队' as dw from dual union select '刑侦支队' as dw from dual "+
" union select '视侦支队' as dw from dual union select '监管支队' as dw from dual union select '法制支队' as dw from dual"+
" union select '治安支队' as dw from dual union select '消防支队' as dw from dual union select '出入境支队' as dw from dual"+
" union select '禁毒支队' as dw from dual union select '网安支队' as dw from dual union select '内保支队' as dw from dual"+
" union select '交管支队' as dw from dual union select '江岸区分局' as dw from dual union select '江汉区分局' as dw from dual"+
" union select '硚口区分局' as dw from dual union select '汉阳区分局' as dw from dual union select '武昌区分局' as dw from dual"+
" union select '青山区分局' as dw from dual union select '洪山区分局' as dw from dual union select '东西湖区分局' as dw from dual"+
" union select '蔡甸区分局' as dw from dual union select '江夏区分局' as dw from dual union select '黄陂区分局' as dw from dual"+
" union select '新洲区分局' as dw from dual union select '水上分局' as dw from dual union select '经济技术开发区分局(汉南区)' as dw from dual"+
" union select '东湖新技术开发区分局' as dw from dual union select '东湖生态旅游风景区分局' as dw from dual union select '化学工业区分局' as dw from dual"+
" union select '轨道交通分局' as dw from dual) t3"+
" left join ("+
" select nvl(t1.dw,t2.dw) as dw,nvl(azl,0) as azl,nvl(t1.adhf,0) as adhf,nvl(t1.ayhf,0) as ayhf,nvl(czl,0) as czl,nvl(t2.cdhf,0) as cdhf,nvl(t2.cyhf,0) as cyhf from"+
" (select nvl(zbcompany,'便民中心') as dw,"+
" count(case when status = '0' then 0 end) as adhf,"+
" count(case when status = '1' then 0 end) as ayhf,"+
" count(*) as azl"+
" from advisory@online_nw where "+advisorytimeSql+
" zbcompany is null group by zbcompany "+
" union all"+
" select nvl(zbcompany,'便民中心') as dw,"+
" count(case when status = '2' then 0 end) as adhf,"+
" count(case when status = '1' then 0 end) as ayhf,"+
" count(*) as azl"+
" from advisory@online_nw where "+advisorytimeSql+
" zbcompany is not null group by zbcompany) t1"+
" full join"+
" (select nvl(zbcompany,'便民中心') as dw,"+
" count(case when status = '0' then 0 end) as cdhf,"+
" count(case when status = '1' then 0 end) as cyhf,"+
" count(*) as czl"+
" from complain@wsjj_smzj where "+timeSql+
" zbcompany is null group by zbcompany "+
" union all"+
" select nvl(zbcompany,'便民中心') as dw,"+
" count(case when status = '2' then 0 end) as cdhf,"+
" count(case when status = '1' then 0 end) as cyhf,"+
" count(*) as czl"+
" from complain@wsjj_smzj where "+timeSql+
" zbcompany is not null group by zbcompany) t2"+
" on t1.dw = t2.dw) t4"+
" on t4.dw = t3.dw order by dw";

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!