SQL一次插入多个元组

来源:百度知道 编辑:UC知道 时间:2024/06/14 00:21:29
insert into Student
values (('1201','吴华', '女',20,'成都','计算机系',null),('1102','张军', '男',21,'上海','工程系',null));
为什么报错,如果不行,那用什么一次插入多个元组,用一条语句完成,不用几个insert

insert Student SELECT '1201','吴华', '女',20,'成都','计算机系',null
UNION SELECT '1102','张军', '男',21,'上海','工程系',null

insert into Product(P_name,P_num)
select '1',2
union all
select '2',2

应该是可以的可能是写法有误,我没遇到过.在网上找找相关资料吧.