常见的insert语句,向数据库中,一条语句只能插入一条数据:
-- 一条insert只能插入一条数据
insert into person (id, personCode, personName , telNumber)values(1,'5112403' , '张三' , '1378902134');
一次插入多条数据的方法:
方式一:
insert into person (id, personCode, personName , telNumber)
values
(1,'5112403' , '张三1' , '1378902134'),
(2,'5112404' , '张三2' , '1378902135'),
(3,'5112405' , '张三3' , '1378902137');
方式二:
insert into person (id, personCode, personName , telNumber)
select id, personCode,personName,telNumber from person2 ;