Home  >  Article  >  Database  >  mssql 两种数据插入方式

mssql 两种数据插入方式

WBOY
WBOYOriginal
2016-06-07 17:58:261243browse

下面那种不太常见的插入方法。

--常用的方式
代码如下:
insert into jobs(job_desc,min_lvl,max_lvl) values('SQL语句插入数据A',45,54)
insert into jobs(job_desc,min_lvl,max_lvl) values('SQL语句插入数据B',45,54)
insert into jobs(job_desc,min_lvl,max_lvl) values('SQL语句插入数据C',45,54)

--比较简单的方式
代码如下:
insert into jobs(job_desc,min_lvl,max_lvl)
select 'SQL语句插入数据A',45,54
union all select 'SQL语句插入数据B',45,54
union all select 'SQL语句插入数据C',45,54
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn