赞
踩
标准语法:
insert into 表名(列名...) values(...)
示例如下:
insert into Department(DepartmentName,DepartmentRemark) values('市场部','1')
insert into Department(DepartmentName,DepartmentRemark) values('软件部','2')
insert into Department(DepartmentName,DepartmentRemark) values('保安部','3')
简写语法(省略字段名称):
insert into Department values('硬件部','4')
最好不要简写,因为数据表结构可能会发生变化,
比如字段的顺序变了,那对于的数据类型也会变了。
一次插入多行数据:
insert into Department(DepartmentName,DepartmentRemark)
select '测试部','5' union--union表示连接
select '施工部','6' union
select '产品部','7'
insert into [Rank](RankName,RankRemark)
values('初级','1')
insert into [Rank](RankName,RankRemark)
select '中级','2' union
select '高级','3'
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。