展开全部
直接上代码: 你自己把grop by 加上去,我就不全部写完了。
测试:
结果32313133353236313431303231363533e59b9ee7ad9431333337383938:
换条件再测试:
结果:
代码:
create or replace procedure test_a(a varchar2,b varchar2,c varchar2) is
q varchar2(100);
w varchar2(100);
e varchar2(100);
d varchar2(100);
begin
if a is null then q:=0;
else q:=a;
end if;
if b is null then w:=0;
else w:=b;
end if;
if c is null then e:=0;
else e:=c;
end if;
d:='select '||q||','||w||','||e||' from xx';
dbms_output.put_line(d);
end
;