declare cursor my_test is select a1 from tb_name where a2 = 2; v_temp varchar2(100); v_tempf varchar2(2000); begin v_tempf := null; for c_test in my_test loop v_tempf := v_tempf || c_test.a1; end loop; end;写虽然这样写,但是我还是担心你的记录数太多,合成的字符串超长,但是基本思想是这样了,你再根据实际情况改下吧.
cursor my_test is
select a1 from tb_name where a2 = 2;
v_temp varchar2(100);
v_tempf varchar2(2000);
begin
v_tempf := null;
for c_test in my_test loop
v_tempf := v_tempf || c_test.a1;
end loop;
end;写虽然这样写,但是我还是担心你的记录数太多,合成的字符串超长,但是基本思想是这样了,你再根据实际情况改下吧.