这个sql语句怎么能查询出来,求高手帮忙

selectpro.xzqhdm,sum(nvl2(view1.djsj,0,1))kxs,count(1)zs,to_char(round((sum(nvl2(view... select pro.xzqhdm,sum(nvl2(view1.djsj,0,1)) kxs,count(1) zs , to_char( round((sum(nvl2(view1.djsj,0,1))/count(1))*100,3),'FM90.999') || '%' kxl from (
select ywhs.djsj,sl.ywh from (
select ql.djsj,ql.ywh from bdcjck.bdcjcs_YGDJ ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_QTXGQL ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_LQ ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_jsydsyq ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_gjzwsyq ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_hysyq ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_dyiq ql
union all
select ql.djsj,ql.ywh from bdcjck.bdcjcs_yydj ql
) ywhs inner join bdcjck.bdcjcs_slsq sl on ywhs.ywh = sl.ywh
union all
select slsqbsms.djsj,sl.ywh from (
select ql.djsj,to_char(ql.slsqbsm) slsqbsm from bdcjck.bdcjcs_NYDSYQ ql
union all
select ql.djsj,to_char(ql.slsqbsm) slsqbsm from bdcjck.bdcjcs_FDCQ2 ql
union all
select ql.djsj,to_char(ql.slsqbsm) slsqbsm from bdcjck.bdcjcs_FDCQ1 ql
union all
select ql.djsj,to_char(ql.slsqbsm) slsqbsm from bdcjck.bdcjcs_DYAQ ql
union all
select ql.djsj,to_char(ql.slsqbsm) slsqbsm from bdcjck.bdcjcs_CFDJ ql
union all
select ql.djsj,to_char(ql.slsqbsm) slsqbsm from bdcjck.bdcjcs_tdsyq ql
) slsqbsms inner join bdcjck.bdcjcs_slsq sl on slsqbsms.slsqbsm = sl.bsm
) view1 inner join
jointserver.ts_project pro on view1.ywh = pro.ywh
where pro.scsj >= :KSSJ and pro.scsj<= :JSSJ and instr (pro.xzqhdm, :QXDM )>0 group by pro.xzqhdm
其中where pro.scsj >= :KSSJ and pro.scsj<= :JSSJ and instr (pro.xzqhdm, :QXDM )>0
kssj要改成函数类型的时间怎么更改啊,一直行就提示并非所有变量都已绑定就是这的问题
展开
 我来答
zxzsky520
2019-05-22 · TA获得超过1678个赞
知道小有建树答主
回答量:1604
采纳率:78%
帮助的人:355万
展开全部
你这:kssj是代码中的前端输入的变量
你要查询 必须 替换成指定时间参数,还有 :QXDM这个这个注释掉,或者你赋值一个需要搜索的开始字符
修改如下:
where pro.scsj >= to_date('2019-05-01 00:00:00','YYYY-MM-DD HH24:mi:ss') and pro.scsj<= to_date('2019-05-22 23:59:59','YYYY-MM-DD HH24:mi:ss') and instr (pro.xzqhdm, '需要搜索的字符' )>0 group by pro.xzqhdm;
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式