try:VARIABLE RQ NUMBER;--ADDSQL> select a.zjs,e.kjs,b.rlyl,c.ylly,d.hzrc,d.hzyl from (select count(jh) zjs from ly01) a,
2 (select sum(rcyl) rlyl from dba01l where rq=:rq) b,
3 (select sum(rcyl) ylly from dba01l where to_char(rq,'yyyymmdd') between to_char(:rq,'yyyymm')||
'01' and to_char(:rq,'yyyymmdd') ) c,
4 (select hzrc,hzyl from d01_1 where rq=:rq) d,
5 (select count(jh) kjs from ly02 where rq=:rq) e;
2 (select sum(rcyl) rlyl from dba01l where rq=:rq) b,
3 (select sum(rcyl) ylly from dba01l where to_char(rq,'yyyymmdd') between to_char(:rq,'yyyymm')||
'01' and to_char(:rq,'yyyymmdd') ) c,
4 (select hzrc,hzyl from d01_1 where rq=:rq) d,
5 (select count(jh) kjs from ly02 where rq=:rq) e;
应该是变量rq没有定义。
v_rq dba01l.rq%type;
select a.zjs,e.kjs,b.rlyl,c.ylly,d.hzrc,d.hzyl from (select count(jh) zjs from ly01) a,
(select sum(rcyl) rlyl from dba01l where rq=v_rq) b,
(select sum(rcyl) ylly from dba01l where to_char(rq,'yyyymmdd') between to_char(v_rq,'yyyymm')||
'01' and to_char(v_rq,'yyyymmdd') ) c,
(select hzrc,hzyl from d01_1 where rq=v_rq) d,
(select count(jh) kjs from ly02 where rq=v_rq) e;只有字符串语句才有占位符
var 一个就可以了