一. 區別:
insert into select: 用於將select出來的結果集復制到一個新表中, 它是標准的sql語句
select into: 將結果保存到一個變量中, 它是plsql的賦值語句
二. 例子:
insert into select:
insert into test select * from t_source where id = 1; commit;select into:
create or replace procedure my_test is aa varchar2(100); v_record t_source%rowtype; begin select name into aa from t_source where id = 1; dbms_output.put_line('普通變量 name= ' || aa); select * into v_record from t_source where id = 1; dbms_output.put_line('記錄變量 name= ' || v_record.name); end;