– oracle双重循环组装sql语句
DECLARE
x number; --声明变量
BEGIN
x:=0; --给初值
FOR mf IN (SELECT agy_code FROM table_a WHERE year = 2022) LOOP
FOR tm IN (SELECT agy_name FROM table_b WHERE year = 2022) LOOP
x:=0;
dbms_output.put_line(mf.agy_code || tm.agy_name);
END LOOP;
END LOOP;
END;
– 注意:此处的变量暂时未用到,可删除