oracle 一次插入多条

insert into test1 (TID, TNAME)
select * from (
select 1,11 from dual union all
select 2,22 from dual union all
select 3,33 from dual
)


这段代码会出错,因为有2个相同的值在里面,必须加别名 as **
insert into test1 (TID, TNAME)
select * from (
select 1,11,11 from dual union all
select 2,22,22 from dual union all
select 3,33,33 from dual
)


所以,最好用 ? ,把值set进去

你可能感兴趣的:(oracle 一次插入多条)